#nullable enable
// These classes use a key binding system based on the design implemented in Scintilla.Net which is an
// MIT licensed open source project https://github.com/jacobslusser/ScintillaNET/blob/master/src/ScintillaNET/Command.cs
namespace Terminal.Gui;
///
/// Provides a collection of objects that are scoped to .
///
public record struct KeyBinding
{
/// Initializes a new instance.
/// The commands this key binding will invoke.
/// The scope of the .
/// Arbitrary context that can be associated with this key binding.
public KeyBinding (Command [] commands, KeyBindingScope scope, object? context = null)
{
Commands = commands;
Scope = scope;
Context = context;
}
/// Initializes a new instance.
/// The commands this key binding will invoke.
/// The scope of the .
/// The view the key binding is bound to.
/// Arbitrary context that can be associated with this key binding.
public KeyBinding (Command [] commands, KeyBindingScope scope, View? boundView, object? context = null)
{
Commands = commands;
Scope = scope;
BoundView = boundView;
Context = context;
}
/// The commands this key binding will invoke.
public Command [] Commands { get; set; }
/// The scope of the .
public KeyBindingScope Scope { get; set; }
/// The view the key binding is bound to.
public View? BoundView { get; set; }
///
/// Arbitrary context that can be associated with this key binding.
///
public object? Context { get; set; }
}