Esempio n. 1
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();
     if (reader.ReadToDescendant("sections"))
     {
         this.EnsureSections();
         if (reader.ReadToDescendant("section"))
         {
             int depth = reader.Depth;
             do
             {
                 ConfigurationSection section = new ConfigurationSection(string.Empty);
                 section.ReadXml(reader);
                 this._sections.Add(section.ConfigKey, section);
                 reader.MoveToElement();
                 while (depth < reader.Depth && reader.Read())
                 {
                 }
             }
             while (reader.ReadToNextSibling("section"));
         }
     }
 }
Esempio n. 2
0
 public IConfigurationSection Clone()
 {
     ConfigurationSection clone = new ConfigurationSection(this.ConfigKey);
     clone.Elements = this.Elements.Clone(clone);
     return clone;
 }