Ejemplo n.º 1
0
        public void Undo(int numberOfUndos = 1)
        {
            for (int i = 0; i < numberOfUndos; i++)
            {
                var command = stack.Undo();
                if (command == null)
                {
                    throw new ApplicationException();
                }

                command.Undo();
                RaiseOperationExecuted(command, ExecutionOperation.Undo);
            }
        }
Ejemplo n.º 2
0
        public void Undo(int numberOfUndos = 1)
        {
            for (int i = 0; i < numberOfUndos; i++)
            {
                var command = stack.Undo();
                if (command == null)
                {
                    throw new ApplicationException();
                }

                command.Undo();
                RaiseOperationExecuted(command, CommandOperation.Undo);

                if (command.isImplicit)
                {
                    i--; // Do not increase undo counter if command is implicit
                }
            }
        }