예제 #1
0
 public void AddDocAction(DocumentAction docAct)
 {
     if (_editSession.EnableUndoHistoryRecording)
     {
         _undoList.AddLast(docAct);
         EnsureCapacity();
     }
 }
예제 #2
0
 public DocumentAction PopUndoCommand()
 {
     if (_undoList.Count > 0)
     {
         DocumentAction lastCmd = _undoList.Last.Value;
         _undoList.RemoveLast();
         return(lastCmd);
     }
     else
     {
         return(null);
     }
 }
예제 #3
0
        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);
            }
        }
예제 #4
0
        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);
            }
        }
예제 #5
0
 public virtual void AddDocAction(DocumentAction docAct)
 {
 }