Beispiel #1
0
        public void Execute()
        {
            StackedCommand undoneCommand = GetUndoneCommand();

            undoneCommand.UnExecute();

            if (UndoExecuted != null)
            {
                UndoExecuted(undoneCommand);
            }

            Controller.InvokeExecutedCommand(undoneCommand, false, null, true, false);
        }
Beispiel #2
0
        public void Execute()
        {
            StackedCommand redoneCommand = GetRedoneCommand();

            redoneCommand.ExecuteAsRedo();

            if (RedoExecuted != null)
            {
                RedoExecuted(redoneCommand);
            }

            Controller.InvokeExecutedCommand(redoneCommand, false, null, false, true);
        }
Beispiel #3
0
        private StackedCommand GetUndoneCommand()
        {
            StackedCommand topStackedCommandModel = Controller.UndoStack.Empty ? null : Controller.UndoStack.Peek();
            StackedCommand undoneCommand;

            if (topStackedCommandModel != null)
            {
                undoneCommand = topStackedCommandModel;
            }
            else
            {
                throw new InvalidOperationException(CommandErrors.CMDERR_STACK_INCONSISTENT);
            }
            return(undoneCommand);
        }