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