using System; using System.Collections.Generic; using ZeroLevel.Services.Serialization; namespace ZeroLevel { /// /// Named configuration sections array /// public interface IConfigurationSet : IEquatable, IBinarySerializable { #region Properties /// /// Default section, always exists /// IConfiguration Default { get; } /// /// Get configuration section by name /// IConfiguration this[string sectionName] { get; } /// /// Get configuration section names /// IEnumerable SectionNames { get; } /// /// Get all sections /// IEnumerable Sections { get; } /// /// true if changing disallow /// bool SectionsFreezed { get; } #endregion Properties #region Methods /// /// Create section /// /// Section name IConfiguration CreateSection(string sectionName); IConfiguration CreateSection(string sectionName, IConfiguration config); /// /// Get configuration section by name /// /// Section name /// Data section IConfiguration GetSection(string sectionName); /// /// Check for a section by name /// /// Section name bool ContainsSection(string sectionName); /// Remove section by name /// /// Section name bool RemoveSection(string sectionName); /// /// Sets a prohibition on changing configurations /// bool FreezeConfiguration(bool permanent = false); /// /// Sets a prohibition on changing sections /// bool FreezeSections(bool permanent = false); /// /// Remove a prohibition on changing configurations /// /// false - if the prohibition is removed bool UnfreezeConfiguration(); /// /// Sets a prohibition on changing sections /// bool UnfreezeSections(); void Merge(IConfigurationSet set); #endregion Methods T Bind(); } }