예제 #1
0
 public IConfigurationElementAttribute Clone()
 {
     ConfigurationElementAttribute clone = new ConfigurationElementAttribute(this.ConfigKey);
     clone.ConfigKey = this.ConfigKey;
     clone.Value = this.Value;
     return clone;
 }
예제 #2
0
        public IConfigurationElementAttribute Clone()
        {
            ConfigurationElementAttribute clone = new ConfigurationElementAttribute(this.ConfigKey);

            clone.ConfigKey = this.ConfigKey;
            clone.Value     = this.Value;
            return(clone);
        }
예제 #3
0
        public override void ReadXml(XmlReader reader)
        {
            if (null == reader)
            {
                throw new ArgumentNullException("reader");
            }
            if (reader.EOF)
            {
                throw new ArgumentException("reader is at EOF");
            }
            reader.MoveToElement();
            base.ReadXml(reader);
            reader.MoveToContent();
            int elementDepth = reader.Depth;

            if (reader.ReadToDescendant("attributes"))
            {
                this.EnsureAttributes();
                if (reader.ReadToDescendant("attribute"))
                {
                    int depth = reader.Depth;
                    do
                    {
                        ConfigurationElementAttribute attribute = new ConfigurationElementAttribute(string.Empty);
                        attribute.ReadXml(reader);
                        this._attributes.Add(attribute.ConfigKey, attribute);
                        reader.MoveToElement();
                        while (depth < reader.Depth && reader.Read())
                        {
                        }
                    }while (reader.ReadToNextSibling("attribute"));
                }
            }
            while (elementDepth < reader.Depth - 1 && reader.Read())
            {
            }
            if (reader.ReadToNextSibling("elements"))
            {
                this.EnsureElements();
                if (reader.ReadToDescendant("element"))
                {
                    int depth = reader.Depth;
                    do
                    {
                        ConfigurationElement element = new ConfigurationElement(string.Empty);
                        element.ReadXml(reader);
                        this._elements.Add(element.ConfigKey, element);
                        reader.MoveToElement();
                        while (depth < reader.Depth && reader.Read())
                        {
                        }
                    }while (reader.ReadToNextSibling("element"));
                }
            }
        }
예제 #4
0
 public override void ReadXml(XmlReader reader)
 {
     if (null == reader)
     {
         throw new ArgumentNullException("reader");
     }
     if (reader.EOF)
     {
         throw new ArgumentException("reader is at EOF");
     }
     reader.MoveToElement();
     base.ReadXml(reader);
     reader.MoveToContent();
     int elementDepth = reader.Depth;
     if (reader.ReadToDescendant("attributes"))
     {
         this.EnsureAttributes();
         if (reader.ReadToDescendant("attribute"))
         {
             int depth = reader.Depth;
             do
             {
                 ConfigurationElementAttribute attribute = new ConfigurationElementAttribute(string.Empty);
                 attribute.ReadXml(reader);
                 this._attributes.Add(attribute.ConfigKey, attribute);
                 reader.MoveToElement();
                 while (depth < reader.Depth && reader.Read())
                 {
                 }
             }
             while (reader.ReadToNextSibling("attribute"));
         }
     }
     while (elementDepth < reader.Depth - 1 && reader.Read())
     {
     }
     if (reader.ReadToNextSibling("elements"))
     {
         this.EnsureElements();
         if (reader.ReadToDescendant("element"))
         {
             int depth = reader.Depth;
             do
             {
                 ConfigurationElement element = new ConfigurationElement(string.Empty);
                 element.ReadXml(reader);
                 this._elements.Add(element.ConfigKey, element);
                 reader.MoveToElement();
                 while (depth < reader.Depth && reader.Read())
                 {
                 }
             }
             while (reader.ReadToNextSibling("element"));
         }
     }
 }