Esempio n. 1
0
        private static void Main(string[] args)
        {
            var invoker = new Invoker();

            var      receiver = new Receiver();
            ICommand command1 = new CommandOne(receiver);
            ICommand command2 = new CommandTwo(receiver);
            ICommand command3 = new CommandThree(receiver);

            invoker.InvokeCommand(command1);
            Console.WriteLine();
            invoker.InvokeCommand(command2);
            Console.WriteLine();
            invoker.InvokeCommand(command3);

            Console.ReadKey();
        }
Esempio n. 2
0
		static void Main(string[] args) {

			var invoker = new Invoker();

			var receiver = new Receiver();
			ICommand command = new ConcreteCommand(receiver);
			
			invoker.InvokeCommand(command);

			Console.ReadKey();
		}
        static void Main(string[] args)
        {
            var invoker = new Invoker();

            var      receiver = new Receiver();
            ICommand command  = new ConcreteCommand(receiver);

            invoker.InvokeCommand(command);

            Console.ReadKey();
        }