// ReSharper restore InconsistentNaming #region Overrides of XmlObject public override void ReadXml(XmlReader reader) { reader.MoveToContent(); while (!reader.EOF) { if (reader.IsStartElement()) { switch (reader.LocalName) { case "Format": Format.Add(reader.ReadElementContentAsString()); break; case "DCPType": var tmp = new DCPType(); tmp.ReadXml(reader); DCPType.Add(tmp); break; default: reader.Skip(); break; } } else { reader.Read(); } } }
public OperationType(XElement node, string @namespace) { foreach (var formatNode in node.Elements(XName.Get("Format", @namespace))) { Format.Add(formatNode.Value); } foreach (var dcptype in node.Elements(XName.Get("DCPType", @namespace))) { DCPType.Add(new DCPType(dcptype, @namespace)); } if (Format.Count < 1) { throw WmsParsingException.ElementNotFound("Format"); } if (DCPType.Count < 1) { throw WmsParsingException.ElementNotFound("DCPType"); } }