protected override void DiscardUndoUnit(UndoEngine.UndoUnit unit) { this.undoUnitList.Remove(unit); this.currentPos--; base.DiscardUndoUnit(unit); this.UpdateUndoRedoMenuCommandsStatus(); }
protected override void AddUndoUnit(UndoEngine.UndoUnit unit) { undoUnitList.RemoveRange(currentPos, undoUnitList.Count - currentPos); undoUnitList.Add(unit); currentPos = undoUnitList.Count; UpdateUndoRedoMenuCommandsStatus(); }
protected override void DiscardUndoUnit(UndoEngine.UndoUnit unit) { base.DiscardUndoUnit(unit); if (_undoUnits.Count > 0 && Object.ReferenceEquals(unit, _undoUnits.Peek())) { _undoUnits.Pop(); } }
protected override void AddUndoUnit(UndoEngine.UndoUnit unit) { if (Enabled) { _undoStack.Push(unit); _redoStack.Clear(); } }
public void Undo() { if (this.undoStack.Count > 0) { UndoEngine.UndoUnit item = this.undoStack.Pop(); item.Undo(); this.redoStack.Push(item); } }
public void Redo() { if (redoStack.Count > 0) { UndoEngine.UndoUnit unit = redoStack.Pop(); unit.Undo(); undoStack.Push(unit); } }
public void Undo() { if (undoStack.Count > 0) { UndoEngine.UndoUnit unit = undoStack.Pop(); undoUnitName = unit.Name; unit.Undo(); redoStack.Push(unit); } }
public void DoUndo() { if (currentPos > 0) { UndoEngine.UndoUnit undoUnit = undoUnitList[currentPos - 1]; undoUnit.Undo(); currentPos--; } UpdateUndoRedoMenuCommandsStatus(); }
public void DoRedo() { if (currentPos < undoUnitList.Count) { UndoEngine.UndoUnit undoUnit = undoUnitList[currentPos]; undoUnit.Undo(); currentPos++; } UpdateUndoRedoMenuCommandsStatus(); }
public void DoRedo() { if (this.currentPos < this.undoUnitList.Count) { UndoEngine.UndoUnit undoUnit = this.undoUnitList[this.currentPos]; undoUnit.Undo(); this.currentPos++; } this.UpdateUndoRedoMenuCommandsStatus(); }
public void DoUndo() { if (this.currentPos > 0) { UndoEngine.UndoUnit undoUnit = this.undoUnitList[this.currentPos - 1]; undoUnit.Undo(); this.currentPos--; } this.UpdateUndoRedoMenuCommandsStatus(); }
protected override void AddUndoUnit(UndoEngine.UndoUnit unit) { this.undoUnitList.RemoveRange(this.currentPos, this.undoUnitList.Count - this.currentPos); if (this.undoUnitList.Count > 100) { this.undoUnitList.RemoveAt(0); } this.undoUnitList.Add(unit); this.currentPos = this.undoUnitList.Count; this.UpdateUndoRedoMenuCommandsStatus(); }
/// <summary> /// 放弃 UndoEngine.UndoUnit。 /// </summary> /// <param name="unit"></param> protected override void DiscardUndoUnit(UndoEngine.UndoUnit unit) { //undoUnitList.Remove(unit); base.DiscardUndoUnit(unit); if (cassPropertyGrid != null) { cassPropertyGrid.Refresh(); } //this.Enabled = false; }
/// <summary> /// 将 UndoEngine.UndoUnit 添加到撤消堆栈中。 /// </summary> /// <param name="unit"></param> protected override void AddUndoUnit(UndoEngine.UndoUnit unit) { tempUnList.Add(unit); if (editToolStripMenuItem.DropDownItems.Count > 0) { editToolStripMenuItem.DropDownItems[undoIndex].Enabled = true; } if (cassPropertyGrid != null) { cassPropertyGrid.Refresh(); } //this.Enabled = false; }
public void Redo() { if (redoStack.Count > 0) { try { UndoEngine.UndoUnit unit = redoStack.Pop(); unit.Undo(); undoStack.Push(unit); //Log("::Redo - redo action performed: " + unit.Name); } catch { //Log("::Redo() - Exception " + ex.Message + " (line:" + new StackFrame(true).GetFileLineNumber() + ")"); } } else { //Log("::Redo - NO redo action to perform!"); } }
public void Undo() { if (undoStack.Count > 0) { try { UndoEngine.UndoUnit unit = undoStack.Pop(); unit.Undo(); redoStack.Push(unit); //Log("::Undo - undo action performed: " + unit.Name); } catch (Exception ex) { Debug.WriteLine(_Name_ + ex.Message); //Log("::Undo() - Exception " + ex.Message + " (line:" + new StackFrame(true).GetFileLineNumber() + ")"); } } else { //Log("::Undo - NO undo action to perform!"); } }
public void Redo( ) { if (redoStack.Count > 0) { try { UndoEngine.UndoUnit unit = redoStack.Pop(); unit.Undo(); undoStack.Push(unit); //Update the CanUndo and CanRedo state CanUndo = undoStack.Count == 0?false:true; CanRedo = redoStack.Count == 0?false:true; //Log("::Redo - redo action performed: " + unit.Name); } catch (Exception ex) { //Log("::Redo() - Exception " + ex.Message + " (line:" + new StackFrame(true).GetFileLineNumber() + ")"); } } else { //Log("::Redo - NO redo action to perform!"); } }
protected override void AddUndoUnit(UndoEngine.UndoUnit unit) { undoStack.Push(unit); }
protected override void DiscardUndoUnit(UndoEngine.UndoUnit unit) { undoUnitList.Remove(unit); base.DiscardUndoUnit(unit); }
protected override void AddUndoUnit(UndoEngine.UndoUnit unit) { undoUnitList.RemoveRange(currentPos, undoUnitList.Count - currentPos); undoUnitList.Add(unit); currentPos = undoUnitList.Count; }
protected override void AddUndoUnit(UndoEngine.UndoUnit unit) { _undoUnits.Push(unit); _redoUnits.Clear(); }