public override void ReadXml(XmlReader reader) { reader.MoveToContent(); if (reader.IsEmptyElement) { reader.Read(); return; } Name = Title = Abstract = null; LegendURL.Clear(); _styleSheetURLField = null; _styleURLField = null; while (!reader.EOF) { if (reader.IsStartElement()) { switch (reader.LocalName) { case "Name": Name = reader.ReadElementContentAsString(); break; case "Title": Title = reader.ReadElementContentAsString(); break; case "Abstract": Abstract = reader.ReadElementContentAsString(); break; case "LegendURL": var legendUrl = new LegendURL(); legendUrl.ReadXml(reader); LegendURL.Add(legendUrl); break; case "StyleSheetURL": _styleSheetURLField = new StyleSheetURL(); _styleSheetURLField.ReadXml(reader); break; case "": _styleURLField = new StyleURL(); _styleURLField.ReadXml(reader); break; default: reader.Skip(); break; } } else { reader.Read(); } } }