DrawEventArgs.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #nullable enable
  2. using System.ComponentModel;
  3. namespace Terminal.Gui;
  4. /// <summary>Event args for draw events</summary>
  5. public class DrawEventArgs : CancelEventArgs
  6. {
  7. /// <summary>Creates a new instance of the <see cref="DrawEventArgs"/> class.</summary>
  8. /// <param name="newViewport">
  9. /// The Content-relative rectangle describing the new visible viewport into the
  10. /// <see cref="View"/>.
  11. /// </param>
  12. /// <param name="oldViewport">
  13. /// The Content-relative rectangle describing the old visible viewport into the
  14. /// <see cref="View"/>.
  15. /// </param>
  16. /// <param name="drawContext">
  17. /// Add any regions that have been drawn to during <see cref="View.Draw(DrawContext?)"/> operations to this context. This is
  18. /// primarily
  19. /// in support of <see cref="ViewportSettings.Transparent"/>.
  20. /// </param>
  21. public DrawEventArgs (Rectangle newViewport, Rectangle oldViewport, DrawContext? drawContext)
  22. {
  23. NewViewport = newViewport;
  24. OldViewport = oldViewport;
  25. DrawContext = drawContext;
  26. }
  27. /// <summary>Gets the Content-relative rectangle describing the old visible viewport into the <see cref="View"/>.</summary>
  28. public Rectangle OldViewport { get; }
  29. /// <summary>Gets the Content-relative rectangle describing the currently visible viewport into the <see cref="View"/>.</summary>
  30. public Rectangle NewViewport { get; }
  31. /// <summary>
  32. /// Add any regions that have been drawn to during <see cref="View.Draw(DrawContext?)"/> operations to this context. This is
  33. /// primarily
  34. /// in support of <see cref="ViewportSettings.Transparent"/>.
  35. /// </summary>
  36. public DrawContext? DrawContext { get; }
  37. }