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(); } }
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);
public ProcessingCommand(ICommand command, ICommandExecuteContext commandExecuteContext, IDictionary<string, string> items) { Message = command; CommandExecuteContext = commandExecuteContext; Items = items ?? new Dictionary<string, string>(); }
public ProcessingCommand(ICommand command, ICommandExecuteContext commandExecuteContext) { Command = command; CommandExecuteContext = commandExecuteContext; }