Beispiel #1
0
        /// <summary>
        /// Rollback current command. It does not saves any changes done in current command.
        /// </summary>
        public void Cancel()
        {
            AssertCurrentCommand();
            log.Add("    [Cancel]");
            Command cancelledCommand = PopCommand();

            cancelledCommand.Undo();
        }
Beispiel #2
0
        /// <summary>Undo last command from history list</summary>
        public void Undo()
        {
            AssertNoCommand();
            if (CanUndo)
            {
                affinityOwner = null;
                Command command = history[currentPosition--];
                log.Add("[Undo '" + command.Caption + "']");
                command.Undo();

                OnCommandDone(command, CommandDoneType.Undo);
            }
        }