예제 #1
0
 protected Command(Receiver receiver)
 {
     this.receiver = receiver;
 }
예제 #2
0
        public CommandPattern()
        {
            Receiver receiver = new Receiver();
            Command command = new ConcreteCommand(receiver);
            Invoker invoker = new Invoker();

            invoker.SetCommand(command);
            invoker.ExecuteCommand();

            command = null;
            invoker.ExecuteCommand();

            //把command赋值为空,但请求者实体里面的command没变,所以还是会执行
        }
예제 #3
0
 public ConcreteCommand(Receiver receiver)
     : base(receiver)
 {
 }