DrawAdornmentsEventArgs.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. namespace Terminal.Gui.ViewBase;
  2. /// <summary>
  3. /// Provides data for events that allow cancellation of adornment drawing in the Cancellable Work Pattern (CWP).
  4. /// </summary>
  5. /// <remarks>
  6. /// <para>
  7. /// Used in events raised by <see cref="View.DoDrawAdornments"/> to allow handlers to cancel the drawing
  8. /// of <see cref="View.Margin"/>, <see cref="View.Border"/>, and <see cref="View.Padding"/> adornments.
  9. /// </para>
  10. /// </remarks>
  11. /// <seealso cref="View.DrawAdornments"/>
  12. /// <seealso cref="CWPEventHelper"/>
  13. public class DrawAdornmentsEventArgs
  14. {
  15. /// <summary>
  16. /// Gets the draw context for tracking drawn regions, or null if not tracking.
  17. /// </summary>
  18. public DrawContext? Context { get; }
  19. /// <summary>
  20. /// Gets or sets a value indicating whether the adornment drawing is handled. If true, drawing is cancelled.
  21. /// </summary>
  22. public bool Handled { get; set; }
  23. /// <summary>
  24. /// Initializes a new instance of the <see cref="DrawAdornmentsEventArgs"/> class.
  25. /// </summary>
  26. /// <param name="context">The draw context, or null if not tracking.</param>
  27. public DrawAdornmentsEventArgs (DrawContext? context)
  28. {
  29. Context = context;
  30. }
  31. }