ExampleCategoryAttribute.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. namespace Terminal.Gui.Examples;
  2. /// <summary>
  3. /// Defines a category for an example application.
  4. /// Apply this attribute to an assembly to associate it with one or more categories for organization and filtering.
  5. /// </summary>
  6. /// <remarks>
  7. /// <para>
  8. /// Multiple instances of this attribute can be applied to a single assembly to associate the example
  9. /// with multiple categories.
  10. /// </para>
  11. /// </remarks>
  12. /// <example>
  13. /// <code>
  14. /// [assembly: ExampleCategory("Text and Formatting")]
  15. /// [assembly: ExampleCategory("Controls")]
  16. /// </code>
  17. /// </example>
  18. [AttributeUsage (AttributeTargets.Assembly, AllowMultiple = true)]
  19. public class ExampleCategoryAttribute : System.Attribute
  20. {
  21. /// <summary>
  22. /// Initializes a new instance of the <see cref="ExampleCategoryAttribute"/> class.
  23. /// </summary>
  24. /// <param name="category">The category name.</param>
  25. public ExampleCategoryAttribute (string category)
  26. {
  27. Category = category;
  28. }
  29. /// <summary>
  30. /// Gets or sets the category name.
  31. /// </summary>
  32. public string Category { get; set; }
  33. }