Example #1
0
        public void Run()
        {
            Receiver receiver = new Receiver();
            Command cmd1 = new ConcreteCommand1(receiver);
            Command cmd2 = new ConcreteCommand2(receiver);
            MacroCommand macro = new MacroCommand();
            macro.Add(cmd1);
            macro.Add(cmd2);

            Invoker invoker = new Invoker();
            invoker.StoreCommand(macro);

            invoker.Invoke();
        }
Example #2
0
 public ConcreteCommand2(Receiver receiver)
 {
     _receiver = receiver;
 }