ConfigLocations.cs 2.4 KB

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