Beispiel #1
0
        // 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();
                }
            }
        }
Beispiel #2
0
        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");
            }
        }
 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();
         }
     }
 }