bin/projects/dbatools/dbatools/Configuration/Config.cs

using System;
using System.Collections;
 
namespace Sqlcollaborative.Dbatools.Configuration
{
    /// <summary>
    /// Configuration Manager as well as individual configuration object.
    /// </summary>
    [Serializable]
    public class Config
    {
        /// <summary>
        /// The central configuration store
        /// </summary>
        public static Hashtable Cfg = new Hashtable();
 
        /// <summary>
        /// The hashtable containing the configuration handler scriptblocks.
        /// When registering a value to a configuration element, that value is stored in a hashtable.
        /// However these lookups can be expensive when done repeatedly.
        /// For greater performance, the most frequently stored values are stored in static fields instead.
        /// In order to facilitate this, an event can be reigstered - which is stored in this hashtable - that will accept the input value and copy it to the target field.
        /// </summary>
        public static Hashtable ConfigHandler = new Hashtable();
 
        /// <summary>
        /// The Name of the setting
        /// </summary>
        public string Name;
 
        /// <summary>
        /// The module of the setting. Helps being able to group configurations.
        /// </summary>
        public string Module;
 
        /// <summary>
        /// A description of the specific setting
        /// </summary>
        public string Description;
 
        /// <summary>
        /// The data type of the value stored in the configuration element.
        /// </summary>
        public string Type
        {
            get
            {
                try { return Value.GetType().FullName; }
                catch { return null; }
            }
            set { }
        }
 
        /// <summary>
        /// The value stored in the configuration element
        /// </summary>
        public Object Value;
 
        /// <summary>
        /// Setting this to true will cause the element to not be discovered unless using the '-Force' parameter on "Get-DbaConfig"
        /// </summary>
        public bool Hidden = false;
    }
}