Example #1
0
        public ExecutionResult ProcessCommand(ICommandBase command)
        {
            ExecutionResult result = null;

            CommandProcessorKey key = new CommandProcessorKey(command.Name);

            //TODO: Не находит соответствия
            ICommandProcessor commandProcessor = this.registeredCommandProcessors[key];

            if (this.registeredCommandNotify.ContainsKey(key))
            {
                ICommandNotifyProcessor notifyHandler = this.registeredCommandNotify[key];

                notifyHandler.BeforeExecute(command);
                commandProcessor.Execute(command);
                //result = commandProcessor.Execute(command);
                notifyHandler.AfterExecute(command);
            }
            else
            {
                //result = commandProcessor.Execute(command);
                commandProcessor.Execute(command);
            }
            return(result);
        }
Example #2
0
        public override ExecutionResult ProcessCommand(ICommandBase command)
        {
            ExecutionResult   result           = null;
            ICommandProcessor commandProcessor = this.CommandHandlers[command.Name];

            if (this.CommandNotifiers.ContainsKey(command.Name))
            {
                ICommandNotifyProcessor notifyHandler = this.CommandNotifiers[command.Name];

                notifyHandler.BeforeExecute(command);
                commandProcessor.Execute(command);
                //result = commandProcessor.Execute(command);
                notifyHandler.AfterExecute(command);
            }
            else
            {
                //result = commandProcessor.Execute(command);
                commandProcessor.Execute(command);
            }
            return(result);
        }