You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Zero/ZeroLevel/Services/Config/IConfigurationSet.cs

97 lines
2.6 KiB

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

Powered by TurnKey Linux.