private void ExecuteCommands(string command, bool isAccepted, List<ICommand> list, CommandExecuteArgs args) { foreach (ICommand c in list) { c.Execute(command, isAccepted); if (args.Handled) return; } }
public void Execute(string command, bool isAccepted) { Task.Factory.StartNew(() => { CommandExecuteArgs args = new CommandExecuteArgs(); ExecuteCommands(command, isAccepted, context.CurrentModule.Commands, args); ExecuteCommands(command, isAccepted, commands, args); }); }