KeyBinding.cs 979 B

1234567891011121314151617181920212223
  1. // These classes use a key binding system based on the design implemented in Scintilla.Net which is an
  2. // MIT licensed open source project https://github.com/jacobslusser/ScintillaNET/blob/master/src/ScintillaNET/Command.cs
  3. namespace Terminal.Gui;
  4. /// <summary>Provides a collection of <see cref="Command"/> objects that are scoped to <see cref="KeyBindingScope"/>.</summary>
  5. public class KeyBinding
  6. {
  7. /// <summary>Initializes a new instance.</summary>
  8. /// <param name="commands"></param>
  9. /// <param name="scope"></param>
  10. public KeyBinding (Command [] commands, KeyBindingScope scope)
  11. {
  12. Commands = commands;
  13. Scope = scope;
  14. }
  15. /// <summary>The actions which can be performed by the application or bound to keys in a <see cref="View"/> control.</summary>
  16. public Command [] Commands { get; set; }
  17. /// <summary>The scope of the <see cref="Commands"/> bound to a key.</summary>
  18. public KeyBindingScope Scope { get; set; }
  19. }