コード例 #1
0
ファイル: DataURL.cs プロジェクト: bertt/BruTile
        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();
                }
            }
        }
コード例 #2
0
        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();
                }
            }
        }
コード例 #3
0
        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();
                }
            }
        }
コード例 #4
0
        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();
            }
        }
コード例 #5
0
ファイル: Service.cs プロジェクト: zwzhlj100000/BruTile
        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();
                }
            }
        }
コード例 #6
0
ファイル: Service.cs プロジェクト: bertt/BruTile
        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();
                }
            }
        }