Esempio n. 1
0
        public void Run()
        {
            Receiver receiver = new Receiver();
            Command cmd = new ConcreteCommand(receiver, "Hello World");

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

            invoker.Invoke();
            invoker.UndoInvoke();
        }
Esempio n. 2
0
 public ConcreteCommand(Receiver receiver, string state)
 {
     _receiver = receiver;
     _state = state;
 }