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); } }