ConfigLocations.cs 2.4 KB

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