예제 #1
0
        static void Main(string[] args)
        {
            ICommandReceiver recevier = new CommandReceiver();
            Invoker          invoker  = new Invoker();

            invoker.Add(new InsertCommand(recevier));
            invoker.Add(new InsertCommand(recevier));
            invoker.Add(new UpdateCommand(recevier));
            invoker.Add(new DeleteCommand(recevier));
            invoker.ExecuteAsync();
        }
예제 #2
0
 /// <summary>
 /// 通够构造方法,明确我们要使用任务接收者
 /// </summary>
 /// <param name="receiver"></param>
 public Method1Command(CommandReceiver receiver)
 {
     this.receiver = receiver;
 }