Command.Invoker.ExecuteCommand C# (CSharp) Method

ExecuteCommand() public method

public ExecuteCommand ( ) : void
return void
        public void ExecuteCommand()
        {
            _command.Execute();
        }

Usage Example

Example #1
0
        private static void Main(string[] args)
        {
            // canonical
            var rec     = new Receiver();
            var command = new ConcreteCommand(rec);
            var invoker = new Invoker();

            invoker.SetCommand(command);
            invoker.ExecuteCommand();
            Console.WriteLine();

            // live
            var user = new User();

            user.Compute('+', 100);
            user.Compute('-', 30);
            user.Compute('*', -1);

            user.Undo(3);
            user.Undo(3);

            user.Redo(2);
            user.Redo(2);
            user.Redo(2);
        }
All Usage Examples Of Command.Invoker::ExecuteCommand