namespace Terminal.Gui.Configuration; /// An attribute indicating a property is managed by . /// /// [ConfigurationProperty(Scope = typeof(AppSettingsScope))] public static string? MyProperty { get; set; } = "MyValue"; /// [AttributeUsage (AttributeTargets.Property)] public class ConfigurationPropertyAttribute : System.Attribute { /// /// If , the property will be serialized to the configuration file using only the property /// name as the key. If , the property will be serialized to the configuration file using the /// property name pre-pended with the classname (e.g. Application.UseSystemConsole). /// public bool OmitClassName { get; set; } private Type? _scope; /// Specifies the scope of the property. If then will be used. public Type? Scope { get { if (_scope is { }) { return _scope; } return typeof (AppSettingsScope); } set { if (value == typeof (AppSettingsScope) && OmitClassName) { throw new ArgumentException ("OmitClassName is not allowed when Scope is AppSettingsScope to ensure property names are globally unique."); } _scope = value; } } }