public override void Intercept(ICommandExecuteContext context)
 {
     (context.Command as TestCommand).Output += 
                             ("Before:TestCommandInterceptor2Attibute");
     context.Proceed();
     (context.Command as TestCommand).Output += 
                             ("After:TestCommandInterceptor2Attibute");
 }
 internal CommandInterceptorChain(
     ICommandExecuteContext commandExecuteContext,
     CommandInterceptorAttribute[] commandInterceptors,
     Action commandExecutor)
 {
     _commandExecuteContext = commandExecuteContext;
     _commandInterceptors = commandInterceptors.OrderBy(x => x.Order).ToArray();
     _commandExecutor = commandExecutor;
 }
        /// <inheritdoc />
        public override void Intercept(ICommandExecuteContext context)
        {
            using (var ts = new TransactionScope())
            {
                context.ExecuteNext();

                ts.Complete();
            }
        }
Exemple #4
0
 public ProcessingCommand(ICommand command, ICommandExecuteContext commandExecuteContext, IDictionary <string, string> items)
 {
     Message = command;
     CommandExecuteContext = commandExecuteContext;
     Items = items ?? new Dictionary <string, string>();
 }
 /// <summary>
 /// 拦截正在被执行的命令。
 /// </summary>
 public abstract void Intercept(ICommandExecuteContext context);
Exemple #6
0
 public ProcessingCommand(ICommand command, ICommandExecuteContext commandExecuteContext, IDictionary<string, string> items)
 {
     Message = command;
     CommandExecuteContext = commandExecuteContext;
     Items = items ?? new Dictionary<string, string>();
 }
Exemple #7
0
 public ProcessingCommand(ICommand command, ICommandExecuteContext commandExecuteContext)
 {
     Command = command;
     CommandExecuteContext = commandExecuteContext;
 }