Exemplo 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();
        }
Exemplo n.º 2
0
 public ConcreteCommand(Receiver receiver, string state)
 {
     _receiver = receiver;
     _state = state;
 }