public object Clone() { Toc clone = new Toc(); foreach (TocGroup tocGroup in this) { clone.Add((TocGroup)tocGroup.Clone()); } return(clone); }
public static Toc ReadFrom(ArcXmlReader reader) { try { Toc toc = new Toc(); if (!reader.IsEmptyElement) { reader.Read(); while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name == XmlName)) { if (reader.NodeType == XmlNodeType.Element) { switch (reader.Name) { case TocGroup.XmlName: toc.Add(TocGroup.ReadFrom(reader)); break; } } reader.Read(); } } return(toc); } catch (Exception ex) { if (ex is ArcXmlException) { throw ex; } else { throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex); } } }