示例#1
0
 public void AddDocAction(DocumentAction docAct)
 {
     if (textdom.EnableUndoHistoryRecording)
     {
         undoList.AddLast(docAct);
         EnsureCapacity();
     }
 }
示例#2
0
 public void ReverseLastUndoAction()
 {
     if (reverseUndoAction.Count > 0)
     {
         textdom.EnableUndoHistoryRecording = false;
         DocumentAction docAction = reverseUndoAction.Pop();
         textdom.EnableUndoHistoryRecording = true;
         docAction.InvokeRedo(textdom);
         undoList.AddLast(docAction);
     }
 }
示例#3
0
        public void UndoLastAction()
        {
            DocumentAction docAction = PopUndoCommand();

            if (docAction != null)
            {
                textdom.EnableUndoHistoryRecording = false;
                docAction.InvokeUndo(textdom);
                textdom.EnableUndoHistoryRecording = true;
                reverseUndoAction.Push(docAction);
            }
        }
示例#4
0
 public DocumentAction PopUndoCommand()
 {
     if (undoList.Count > 0)
     {
         DocumentAction lastCmd = undoList.Last.Value;
         undoList.RemoveLast();
         return(lastCmd);
     }
     else
     {
         return(null);
     }
 }
示例#5
0
 public void AddDocAction(DocumentAction docAct)
 {
     if (textdom.EnableUndoHistoryRecording)
     {
         undoList.AddLast(docAct);
         EnsureCapacity();
     }
 }