AppSettingsScope.cs 943 B

12345678910111213141516171819202122232425262728
  1. using System.Text.Json.Serialization;
  2. namespace Terminal.Gui.Configuration;
  3. /// <summary>The <see cref="Scope{T}"/> class for application-defined configuration settings.</summary>
  4. /// <remarks></remarks>
  5. /// <example>
  6. /// <para>
  7. /// Use the <see cref="ConfigurationPropertyAttribute"/> attribute to mark properties that should be
  8. /// serialized as part of application-defined configuration settings.
  9. /// </para>
  10. /// <code>
  11. /// public class MyAppSettings {
  12. /// [ConfigurationProperty]
  13. /// public static bool? MyProperty { get; set; } = true;
  14. /// }
  15. /// </code>
  16. /// <para>The resultant Json will look like this:</para>
  17. /// <code>
  18. /// "AppSettings": {
  19. /// "MyAppSettings.MyProperty": true,
  20. /// "UICatalog.ShowStatusBar": true
  21. /// },
  22. /// </code>
  23. /// </example>
  24. [JsonConverter (typeof (ScopeJsonConverter<AppSettingsScope>))]
  25. public class AppSettingsScope : Scope<AppSettingsScope>
  26. { }