SerializableConfigurationProperty.cs 1.1 KB

12345678910111213141516171819202122232425262728
  1. using System;
  2. #nullable enable
  3. namespace Terminal.Gui;
  4. /// <summary>
  5. /// An attribute that can be applied to a property to indicate that it should included in the configuration file.
  6. /// </summary>
  7. /// <example>
  8. /// [SerializableConfigurationProperty(Scope = typeof(Configuration.ThemeManager.ThemeScope)), JsonConverter (typeof (JsonStringEnumConverter))]
  9. /// public static LineStyle DefaultBorderStyle {
  10. /// ...
  11. /// </example>
  12. [AttributeUsage (AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
  13. public class SerializableConfigurationProperty : System.Attribute {
  14. /// <summary>
  15. /// Specifies the scope of the property.
  16. /// </summary>
  17. public Type? Scope { get; set; }
  18. /// <summary>
  19. /// If <see langword="true"/>, the property will be serialized to the configuration file using only the property name
  20. /// as the key. If <see langword="false"/>, the property will be serialized to the configuration file using the
  21. /// property name pre-pended with the classname (e.g. <c>Application.UseSystemConsole</c>).
  22. /// </summary>
  23. public bool OmitClassName { get; set; }
  24. }