DrawEventArgs.cs 1.7 KB

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