MouseEventEventArgs.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. namespace Terminal.Gui;
  2. /// <summary>
  3. /// Specifies the event arguments for <see cref="Terminal.Gui.MouseEvent"/>. This is a higher-level construct than
  4. /// the wrapped <see cref="MouseEvent"/> class and is used for the events defined on <see cref="View"/> and subclasses
  5. /// of View (e.g. <see cref="View.MouseEnter"/> and <see cref="View.MouseClick"/>).
  6. /// </summary>
  7. public class MouseEventEventArgs : EventArgs
  8. {
  9. /// <summary>Constructs.</summary>
  10. /// <param name="me">The mouse event.</param>
  11. public MouseEventEventArgs (MouseEvent me) { MouseEvent = me; }
  12. /// <summary>
  13. /// Indicates if the current mouse event has already been processed and the driver should stop notifying any other
  14. /// event subscriber. It's important to set this value to true specially when updating any View's layout from inside the
  15. /// subscriber method.
  16. /// </summary>
  17. /// <remarks>
  18. /// This property forwards to the <see cref="MouseEvent.Handled"/> property and is provided as a convenience and
  19. /// for backwards compatibility
  20. /// </remarks>
  21. public bool Handled
  22. {
  23. get => MouseEvent.Handled;
  24. set => MouseEvent.Handled = value;
  25. }
  26. // TODO: Merge MouseEvent and MouseEventEventArgs into a single class.
  27. /// <summary>The <see cref="Terminal.Gui.MouseEvent"/> for the event.</summary>
  28. public MouseEvent MouseEvent { get; set; }
  29. }