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

92 lines
2.5 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);
6 years ago
/// <summary>
/// Get configuration section by name
6 years ago
/// </summary>
/// <param name="sectionName">Название секции</param>
/// <returns>Секция с данными</returns>
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>
/// <returns>false - если запрет снят</returns>
bool UnfreezeConfiguration();
6 years ago
/// <summary>
/// Sets a prohibition on changing sections
6 years ago
/// </summary>
bool UnfreezeSections();
#endregion Methods
6 years ago
}
}

Powered by TurnKey Linux.