AppScope.cs 1.2 KB

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