Catel.ICommandManagerExtensions.FindCommandsByGesture C# (CSharp) Метод

FindCommandsByGesture() публичный статический Метод

Finds the commands inside the ICommandManager by gesture.
The is null. The is null.
public static FindCommandsByGesture ( this commandManager, Catel.Windows.Input.InputGesture inputGesture ) : ICommand>.Dictionary
commandManager this The command manager.
inputGesture Catel.Windows.Input.InputGesture The input gesture.
Результат ICommand>.Dictionary
        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;
        }