public static TocGroup ReadFrom(ArcXmlReader reader) { try { TocGroup tocGroup = new TocGroup(); if (reader.HasAttributes) { while (reader.MoveToNextAttribute()) { string value = reader.ReadContentAsString(); if (value.Length > 0) { switch (reader.Name) { case "heading": tocGroup.Heading = value; break; } } } reader.MoveToElement(); } if (!reader.IsEmptyElement) { reader.Read(); while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name == XmlName)) { if (reader.NodeType == XmlNodeType.Element) { switch (reader.Name) { case TocClass.XmlName: tocGroup.Add(TocClass.ReadFrom(reader)); break; } } reader.Read(); } } return tocGroup; } catch (Exception ex) { if (ex is ArcXmlException) { throw ex; } else { throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex); } } }
public object Clone() { TocGroup clone = new TocGroup(); clone.Heading = Heading; clone.MinScale = MinScale; clone.MaxScale = MaxScale; foreach (TocClass tocClass in this) { clone.Add((TocClass)tocClass.Clone()); } return clone; }