public static Dictionary<string, ICommand> FindCommandsByGesture(this ICommandManager commandManager, InputGesture inputGesture)
{
Argument.IsNotNull("commandManager", commandManager);
Argument.IsNotNull("inputGesture", inputGesture);
var commands = new Dictionary<string, ICommand>();
foreach (var commandName in commandManager.GetCommands())
{
var commandInputGesture = commandManager.GetInputGesture(commandName);
if (inputGesture.Equals(commandInputGesture))
{
commands[commandName] = commandManager.GetCommand(commandName);
}
}
return commands;
}