AppScope.cs 965 B

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