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

                ts.Complete();
            }
        }
コード例 #4
0
 public ProcessingCommand(ICommand command, ICommandExecuteContext commandExecuteContext, IDictionary <string, string> items)
 {
     Message = command;
     CommandExecuteContext = commandExecuteContext;
     Items = items ?? new Dictionary <string, string>();
 }
コード例 #5
0
 /// <summary>
 /// 拦截正在被执行的命令。
 /// </summary>
 public abstract void Intercept(ICommandExecuteContext context);
コード例 #6
0
ファイル: ProcessingCommand.cs プロジェクト: ulswww/enode
 public ProcessingCommand(ICommand command, ICommandExecuteContext commandExecuteContext, IDictionary<string, string> items)
 {
     Message = command;
     CommandExecuteContext = commandExecuteContext;
     Items = items ?? new Dictionary<string, string>();
 }
コード例 #7
0
ファイル: ProcessingCommand.cs プロジェクト: key-value/enode
 public ProcessingCommand(ICommand command, ICommandExecuteContext commandExecuteContext)
 {
     Command = command;
     CommandExecuteContext = commandExecuteContext;
 }