DrawEventArgs.cs 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. using System.ComponentModel;
  2. namespace Terminal.Gui;
  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. public DrawEventArgs (Rectangle newViewport, Rectangle oldViewport)
  16. {
  17. NewViewport = newViewport;
  18. OldViewport = oldViewport;
  19. }
  20. /// <summary>If set to true, the draw operation will be canceled, if applicable.</summary>
  21. public bool Cancel { get; set; }
  22. /// <summary>Gets the Content-relative rectangle describing the old visible viewport into the <see cref="View"/>.</summary>
  23. public Rectangle OldViewport { get; }
  24. /// <summary>Gets the Content-relative rectangle describing the currently visible viewport into the <see cref="View"/>.</summary>
  25. public Rectangle NewViewport { get; }
  26. }