MouseEventEventArgs.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233
  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. // TODO: Merge MouseEvent and MouseEventEventArgs into a single class.
  15. /// <summary>
  16. /// The <see cref="Terminal.Gui.MouseEvent"/> for the event.
  17. /// </summary>
  18. public MouseEvent MouseEvent { get; set; }
  19. /// <summary>
  20. /// Indicates if the current mouse event has already been processed and the driver should stop notifying any other event subscriber.
  21. /// Its important to set this value to true specially when updating any View's layout from inside the subscriber method.
  22. /// </summary>
  23. /// <remarks>This property forwards to the <see cref="MouseEvent.Handled"/> property and is provided as a convenience and for
  24. /// backwards compatibility</remarks>
  25. public bool Handled {
  26. get => MouseEvent.Handled;
  27. set => MouseEvent.Handled = value;
  28. }
  29. }
  30. }