예제 #1
0
 // Constructor
 public Command(Receiver receiver)
 {
     this.receiver = receiver;
 }
예제 #2
0
 // Constructor
 public ConcreteCommand(Receiver receiver)
     : base(receiver)
 {
 }
예제 #3
0
        private void btnCommand_Click(object sender, EventArgs e)
        {
            Receiver receiver = new Receiver();
            Command command = new ConcreteCommand(receiver);
            Invoker invoker = new Invoker();

            // Set and execute command
            invoker.SetCommand(command);
            invoker.ExecuteCommand();
        }