#nullable enable
namespace Terminal.Gui;
#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved
///
/// Provides context for a that is being invoked.
///
///
///
/// To define a that is invoked with context,
/// use .
///
///
///
///
///
#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved
public record struct CommandContext
{
///
/// Initializes a new instance of with the specified ,
///
///
///
///
///
public CommandContext (Command command, Key? key, KeyBinding? keyBinding = null, object? data = null)
{
Command = command;
Key = key;
KeyBinding = keyBinding;
Data = data;
}
///
/// The that is being invoked.
///
public Command Command { get; set; }
///
/// The that is being invoked. This is the key that was pressed to invoke the .
///
public Key? Key { get; set; }
///
/// The KeyBinding that was used to invoke the , if any.
///
public KeyBinding? KeyBinding { get; set; }
///
/// Arbitrary data.
///
public object? Data { get; set; }
}