Exemple #1
0
        public void Undo()
        {
            if (history.Count > 0)
            {
                var cmd = history.Pop();

                BeginDisableCommands();                //prevent text changing into handlers
                try {
                    cmd.Undo();
                } finally {
                    EndDisableCommands();
                }

                redoStack.Push(cmd);
            }

            //undo next autoUndo command
            if (history.Count > 0)
            {
                UndoableCommand cmd = history.Peek();
                if (cmd.autoUndo || cmd is InsertCharCommand)
                {
                    Undo();
                }
            }

            TextSource.CurrentTB.OnUndoRedoStateChanged();
        }
Exemple #2
0
 public MultiRangeCommand(UndoableCommand command)
     : base(command.ts)
 {
     this.cmd = command;
     range    = ts.CurrentTB.Selection.Clone();
 }