/// <summary> /// On section /// </summary> /// <param name="pSection">Section</param> protected void OnSection(ConfigurationFileSection pSection) { if (this.Section != null) { this.Section(this, new ConfigurationFileSectionEventArgs(pSection)); } }
/// <summary> /// Verifying section (if not found - creating one) /// </summary> protected void VerifySection() { if (this.CurrentSection == null) { this.CurrentSection = new ConfigurationFileSection(); this.Sections.Add(this.CurrentSection); } }
/// <summary> /// Setting a section /// </summary> /// <param name="pSectionName">Section name</param> public void SetSection(string pSectionName) { this.CurrentSection = this.Sections.FirstOrDefault <ConfigurationFileSection>(pSection => pSection.Name == pSectionName); if (this.CurrentSection == null) { this.CurrentSection = new ConfigurationFileSection(pSectionName); this.Sections.Add(this.CurrentSection); } }
/// <summary> /// Standard constructor /// </summary> public ConfigurationFile() { this.Sections = new List <ConfigurationFileSection>(); this.CurrentSection = null; }
/// <summary> /// Standard constructor /// </summary> /// <param name="pSection">Section</param> public ConfigurationFileSectionEventArgs(ConfigurationFileSection pSection) { this.Section = pSection; }