/// <summary> /// Call this method to redo the last undone operation /// </summary> public void Redo() { //AssertNoUndoGroupOpen(); if (redostack.Count > 0) { ZYEditorAction uedit = (ZYEditorAction)redostack.Pop(); undostack.Push(uedit); uedit.Redo(); OnActionRedone(); } }
/// <summary> /// Call this method to push an UndoableOperation on the undostack, the redostack /// will be cleared, if you use this method. /// </summary> public void Push(ZYEditorAction operation) { if (operation == null) { throw new ArgumentNullException("operation"); } if (AcceptChanges) { //StartUndoGroup(); undostack.Push(operation); //actionCountInUndoGroup++; //if (myZYEditorControl != null) //{ // undostack.Push(new UndoableSetCaretPosition(this, myZYEditorControl.ActiveTextAreaControl.Caret.Position)); // actionCountInUndoGroup++; //} //EndUndoGroup(); ClearRedoStack(); } }
public OperationEventArgs(ZYEditorAction op) { this.op = op; }