SerializableConfigurationProperty.cs 1.0 KB

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