MouseEventEventArgs.cs 1.3 KB

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