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

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Collections.Generic;
using ZeroLevel.Services.Serialization;
namespace ZeroLevel
{
/// <summary>
/// Named configuration sections array
/// </summary>
public interface IConfigurationSet :
IEquatable<IConfigurationSet>,
IBinarySerializable
{
#region Properties
/// <summary>
/// Default section, always exists
/// </summary>
IConfiguration Default { get; }
/// <summary>
/// Get configuration section by name
/// </summary>
IConfiguration this[string sectionName] { get; }
/// <summary>
/// Get configuration section names
/// </summary>
IEnumerable<string> SectionNames { get; }
/// <summary>
/// Get all sections
/// </summary>
IEnumerable<IConfiguration> Sections { get; }
/// <summary>
/// true if changing disallow
/// </summary>
bool SectionsFreezed { get; }
#endregion Properties
#region Methods
/// <summary>
/// Create section
/// </summary>
/// <param name="sectionName">Section name</param>
IConfiguration CreateSection(string sectionName);
/// <summary>
/// Get configuration section by name
/// </summary>
/// <param name="sectionName">Название секции</param>
/// <returns>Секция с данными</returns>
IConfiguration GetSection(string sectionName);
/// <summary>
/// Check for a section by name
/// </summary>
/// <param name="sectionName">Section name</param>
bool ContainsSection(string sectionName);
/// <summary>Remove section by name
/// </summary>
/// <param name="sectionName">Section name</param>
bool RemoveSection(string sectionName);
/// <summary>
/// Sets a prohibition on changing configurations
/// </summary>
bool FreezeConfiguration(bool permanent = false);
/// <summary>
/// Sets a prohibition on changing sections
/// </summary>
bool FreezeSections(bool permanent = false);
/// <summary>
/// Remove a prohibition on changing configurations
/// </summary>
/// <returns>false - если запрет снят</returns>
bool UnfreezeConfiguration();
/// <summary>
/// Sets a prohibition on changing sections
/// </summary>
bool UnfreezeSections();
#endregion Methods
}
}

Powered by TurnKey Linux.