ExampleMetadataAttribute.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. namespace Terminal.Gui.Examples;
  2. /// <summary>
  3. /// Defines metadata (Name and Description) for an example application.
  4. /// Apply this attribute to an assembly to mark it as an example that can be discovered and run.
  5. /// </summary>
  6. /// <remarks>
  7. /// <para>
  8. /// This attribute is used by the example discovery system to identify and describe standalone example programs.
  9. /// Each example should have exactly one <see cref="ExampleMetadataAttribute"/> applied to its assembly.
  10. /// </para>
  11. /// </remarks>
  12. /// <example>
  13. /// <code>
  14. /// [assembly: ExampleMetadata("Character Map", "Unicode character viewer and selector")]
  15. /// </code>
  16. /// </example>
  17. [AttributeUsage (AttributeTargets.Assembly)]
  18. public class ExampleMetadataAttribute : System.Attribute
  19. {
  20. /// <summary>
  21. /// Initializes a new instance of the <see cref="ExampleMetadataAttribute"/> class.
  22. /// </summary>
  23. /// <param name="name">The display name of the example.</param>
  24. /// <param name="description">A brief description of what the example demonstrates.</param>
  25. public ExampleMetadataAttribute (string name, string description)
  26. {
  27. Name = name;
  28. Description = description;
  29. }
  30. /// <summary>
  31. /// Gets or sets the display name of the example.
  32. /// </summary>
  33. public string Name { get; set; }
  34. /// <summary>
  35. /// Gets or sets a brief description of what the example demonstrates.
  36. /// </summary>
  37. public string Description { get; set; }
  38. }