Example #1
0
        void Main()
        {
            Invoker         invoker  = new Invoker();
            Receiver        receiver = new Receiver();
            ConcreteCommand command  = new ConcreteCommand(receiver);

            invoker.SetCommand(command);
            invoker.Run();
        }
Example #2
0
        private static void Main()
        {
            // Create receiver, command, and invoker
            Receiver receiver = new Receiver();
            Command  command  = new ConcreteCommand(receiver);
            Invoker  invoker  = new Invoker();

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

            Console.ReadKey();
        }
Example #3
0
        private static void Main()
        {
            // Create receiver, command, and invoker
            Receiver receiver = new Receiver();
            Command command = new ConcreteCommand(receiver);
            Invoker invoker = new Invoker();

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

            Console.ReadKey();
        }
 public AtalhoCopiarTexto(EditorTexto editorTexto)
 {
     _Invoker.SetCommand(new ComandoCopiarTexto(editorTexto));
 }
 public BotaoColarTexto(EditorTexto editorTexto)
 {
     _Invoker.SetCommand(new ComandoColarTexto(editorTexto));
 }