public void ExecuteCommand(Command cmd) { if (disabledCommands > 0) return; //multirange ? if (cmd.ts.CurrentTB.Selection.ColumnSelectionMode) if (cmd is UndoableCommand) //make wrapper cmd = new MultiRangeCommand((UndoableCommand)cmd); if (cmd is UndoableCommand) { //if range is ColumnRange, then create wrapper (cmd as UndoableCommand).autoUndo = autoUndoCommands > 0; history.Push(cmd as UndoableCommand); } try { cmd.Execute(); } catch (ArgumentOutOfRangeException) { //OnTextChanging cancels enter of the text if (cmd is UndoableCommand) history.Pop(); } // redoStack.Clear(); // TextSource.CurrentTB.OnUndoRedoStateChanged(); }
public void ExecuteCommand(Command cmd) { if (disabledCommands > 0) return; if (cmd is UndoableCommand) { (cmd as UndoableCommand).autoUndo = autoUndoCommands > 0; history.Push(cmd as UndoableCommand); } cmd.Execute(); // redoStack.Clear(); }
public void ExecuteCommand(Command cmd) { if (disabledCommands > 0) return; if (cmd is UndoableCommand) { (cmd as UndoableCommand).autoUndo = autoUndoCommands > 0; history.Push(cmd as UndoableCommand); } cmd.Execute(); // redoStack.Clear(); // TextSource.CurrentTB.OnUndoRedoStateChanged(); }
public override void ExecuteCommand(Command cmd) { if (disabledCommands > 0) return; var fctb = TextSource.CurrentTB; if (fctb.AddedCarets.Count != 0) { //multirange ? if (cmd.ts.CurrentTB.Selection.ColumnSelectionMode) return;//we do not suppport column selection mode with multiselect mode //make wrapper if (cmd is UndoableCommand) cmd = new MultiSelectionCommand((UndoableCommand)cmd); } base.ExecuteCommand(cmd); }