2
0

MouseBinding.cs 865 B

123456789101112131415161718192021222324252627
  1. #nullable enable
  2. namespace Terminal.Gui;
  3. /// <summary>
  4. /// Provides a collection of <see cref="Command"/> objects for mouse events.
  5. /// </summary>
  6. /// <seealso cref="Command"/>
  7. public record struct MouseBinding
  8. {
  9. /// <summary>Initializes a new instance.</summary>
  10. /// <param name="commands">The commands this mouse binding will invoke.</param>
  11. /// <param name="mouseEventArgs">The mouse event arguments, to be passed as context.</param>
  12. public MouseBinding (Command [] commands, MouseEventArgs? mouseEventArgs)
  13. {
  14. Commands = commands;
  15. MouseEventArgs = mouseEventArgs;
  16. }
  17. /// <summary>The commands this key binding will invoke.</summary>
  18. public Command [] Commands { get; set; }
  19. /// <summary>
  20. /// The mouse event arguments.
  21. /// </summary>
  22. public MouseEventArgs? MouseEventArgs { get; set; }
  23. }