Base features
This commit is contained in:
22
src/FileTime.ConsoleUI.App/Command/CommandBinding.cs
Normal file
22
src/FileTime.ConsoleUI.App/Command/CommandBinding.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace FileTime.ConsoleUI.App.Command
|
||||
{
|
||||
public class CommandBinding
|
||||
{
|
||||
private readonly Action _commandHandler;
|
||||
|
||||
public string Name { get; }
|
||||
|
||||
public ConsoleKeyInfo[] Keys { get; }
|
||||
public Commands Command { get; }
|
||||
|
||||
public CommandBinding(string name, Commands command, ConsoleKeyInfo[] keys, Action commandHandler)
|
||||
{
|
||||
Name = name;
|
||||
Command = command;
|
||||
Keys = keys;
|
||||
_commandHandler = commandHandler;
|
||||
}
|
||||
|
||||
public void Invoke() => _commandHandler();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user