public void AddDocAction(DocumentAction docAct) { if (_editSession.EnableUndoHistoryRecording) { _undoList.AddLast(docAct); EnsureCapacity(); } }
public DocumentAction PopUndoCommand() { if (_undoList.Count > 0) { DocumentAction lastCmd = _undoList.Last.Value; _undoList.RemoveLast(); return(lastCmd); } else { return(null); } }
public void ReverseLastUndoAction() { if (_reverseUndoAction.Count > 0) { _editSession.EnableUndoHistoryRecording = false; _editSession.UndoMode = true; DocumentAction docAction = _reverseUndoAction.Pop(); _editSession.UndoMode = false; _editSession.EnableUndoHistoryRecording = true; docAction.InvokeRedo(_editSession); _undoList.AddLast(docAction); } }
public void UndoLastAction() { DocumentAction docAction = PopUndoCommand(); if (docAction != null) { _editSession.EnableUndoHistoryRecording = false; _editSession.UndoMode = true; docAction.InvokeUndo(_editSession); //sync content ... _editSession.EnableUndoHistoryRecording = true; _editSession.UndoMode = false; _reverseUndoAction.Push(docAction); } }
public virtual void AddDocAction(DocumentAction docAct) { }