Пример #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)
 {
 }