public override void ReadXml(XmlReader reader) { if (CheckEmptyNode(reader, "DataURL", Namespace)) return; while (!reader.EOF) { if (reader.IsStartElement()) { switch (reader.LocalName) { case "Format": Format = reader.ReadElementContentAsString(); break; case "OnlineResource": OnlineResource = new OnlineResource(); OnlineResource.ReadXml(reader); break; default: reader.Skip(); break; } } else { reader.Read(); } } }
public override void ReadXml(XmlReader reader) { reader.MoveToContent(); if (reader.IsEmptyElement) { reader.Read(); return; } while (!reader.EOF) { if (reader.IsStartElement()) { switch (reader.LocalName) { case "Format": Format = reader.ReadElementContentAsString(); break; case "OnlineResource": OnlineResource = new OnlineResource(); OnlineResource.ReadXml(reader); break; default: reader.Skip(); break; } } else { reader.Read(); } } }
public override void ReadXml(XmlReader reader) { reader.MoveToContent(); var isEmpty = reader.IsEmptyElement; reader.ReadStartElement(); if (!isEmpty) { reader.ReadStartElement("Title"); Title = reader.ReadContentAsString(); reader.ReadEndElement(); OnlineResource.ReadXml(reader); LogoURL.ReadXml(reader); reader.ReadEndElement(); } }
public override void ReadXml(XmlReader reader) { if (CheckEmptyNode(reader, "Service", string.Empty)) { throw WmsParsingException.ElementNotFound("Service"); } while (!reader.EOF) { if (reader.IsStartElement()) { switch (reader.LocalName) { case "Name": string name = reader.ReadElementContentAsString(); const string prefix = "ogc:"; if (name.ToLower().StartsWith(prefix)) { name = name.Substring(prefix.Length); } Name = (ServiceName)Enum.Parse(typeof(ServiceName), name, true); break; case "Title": Title = reader.ReadElementContentAsString(); break; case "Abstact": Abstract = reader.ReadElementContentAsString(); break; case "KeywordList": KeywordList = new KeywordList(); KeywordList.ReadXml(reader); break; case "OnlineResource": OnlineResource = new OnlineResource(); OnlineResource.ReadXml(reader); break; case "ContactInformation": ContactInformation = new ContactInformation(); ContactInformation.ReadXml(reader); break; case "Fees": Fees = reader.ReadElementContentAsString(); break; case "AccessConstraints": AccessConstraints = reader.ReadElementContentAsString(); break; case "LayerLimit": LayerLimit = reader.ReadElementContentAsInt(); break; case "MaxWidth": MaxWidth = reader.ReadElementContentAsInt(); break; case "MaxHeight": MaxHeight = reader.ReadElementContentAsInt(); break; default: reader.Skip(); break; } } else { reader.Read(); } } }
public override void ReadXml(XmlReader reader) { if (CheckEmptyNode(reader, "Service", string.Empty, true)) throw WmsParsingException.ElementNotFound("Service"); while (!reader.EOF) { if (reader.IsStartElement()) { switch (reader.LocalName) { case "Name": string name = reader.ReadElementContentAsString(); const string prefix = "ogc:"; if (name.ToLower().StartsWith(prefix)) name = name.Substring(prefix.Length); Name = (ServiceName)Enum.Parse(typeof(ServiceName), name , true); break; case "Title": Title = reader.ReadElementContentAsString(); break; case "Abstact": Abstract = reader.ReadElementContentAsString(); break; case "KeywordList": KeywordList = new KeywordList(); KeywordList.ReadXml(reader); break; case "OnlineResource": OnlineResource = new OnlineResource(); OnlineResource.ReadXml(reader); break; case "ContactInformation": ContactInformation = new ContactInformation(); ContactInformation.ReadXml(reader); break; case "Fees": Fees = reader.ReadElementContentAsString(); break; case "AccessConstraints": AccessConstraints = reader.ReadElementContentAsString(); break; case "LayerLimit": LayerLimit = reader.ReadElementContentAsInt(); break; case "MaxWidth": MaxWidth = reader.ReadElementContentAsInt(); break; case "MaxHeight": MaxHeight = reader.ReadElementContentAsInt(); break; default: reader.Skip(); break; } } else { reader.Read(); } } }