ConfigLocations.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #nullable enable
  2. namespace Terminal.Gui.Configuration;
  3. /// <summary>
  4. /// Describes the location of the configuration settings. The constants can be combined (bitwise) to specify multiple
  5. /// locations. The more significant the bit, the higher the priority the location, meaning that the last location will
  6. /// override the
  7. /// earlier ones.
  8. /// </summary>
  9. [Flags]
  10. public enum ConfigLocations
  11. {
  12. /// <summary>
  13. /// No locaitons are specified. This is the default value.
  14. /// </summary>
  15. None = 0b_0000_0000,
  16. /// <summary>
  17. /// Settings of the <see cref="ConfigurationPropertyAttribute"/> static properites when the module is
  18. /// initiallly loaded.
  19. /// <para>
  20. /// When the module is initialized, the <see cref="ConfigurationManager"/> will retrieve the values of the
  21. /// configuration
  22. /// properties
  23. /// from their corresponding static properties. These are default settigs available even if
  24. /// <see cref="ConfigurationManager.IsEnabled"/>
  25. /// is <see langword="false"/>.
  26. /// </para>
  27. /// </summary>
  28. HardCoded = 0b_0000_0001,
  29. /// <summary>
  30. /// Settings defined in <c>Terminal.Gui.dll</c>'s resources (<c>Terminal.Gui.Resources.config.json</c>).
  31. /// </summary>
  32. LibraryResources = 0b_0000_0010,
  33. /// <summary>
  34. /// App resources (e.g. <c>MyApp.Resources.config.json</c>). See <see cref="AppSettingsScope"/>.
  35. /// </summary>
  36. AppResources = 0b_0000_0100,
  37. /// <summary>
  38. /// Settings in the <see cref="ConfigurationManager.RuntimeConfig"/> static property.
  39. /// </summary>
  40. Runtime = 0b_0000_1000,
  41. /// <summary>
  42. /// Global settings in the current directory (e.g. <c>./.tui/config.json</c>).
  43. /// </summary>
  44. GlobalCurrent = 0b_0001_0000,
  45. /// <summary>
  46. /// Global settings in the home directory (e.g. <c>~/.tui/config.json</c>).
  47. /// </summary>
  48. GlobalHome = 0b_0010_0000,
  49. /// <summary>
  50. /// App settings in the current directory (e.g. <c>./.tui/MyApp.config.json</c>).
  51. /// </summary>
  52. AppCurrent = 0b_0100_0000,
  53. /// <summary>
  54. /// App settings in the home directory (e.g. <c>~/.tui/MyApp.config.json</c>).
  55. /// </summary>
  56. AppHome = 0b_1000_0000,
  57. /// <summary>This constant is a combination of all locations</summary>
  58. All = 0b_1111_1111
  59. }