Exemplo n.º 1
0
        private bool ProceedWithMerge(MockTextUndoTransaction transaction1, MockTextUndoTransaction transaction2)
        {
            MockTextUndoHistoryRegistry registry = UndoHistoryRegistry;

            return(transaction1.MergePolicy != null &&
                   transaction2.MergePolicy != null &&
                   transaction1.MergePolicy.TestCompatiblePolicy(transaction2.MergePolicy) &&
                   transaction1.MergePolicy.CanMerge(transaction1, transaction2));
        }
Exemplo n.º 2
0
 public MockTextUndoHistory(MockTextUndoHistoryRegistry undoHistoryRegistry)
 {
     _currentTransaction           = null;
     UndoHistoryRegistry           = undoHistoryRegistry;
     _undoStack                    = new Stack <ITextUndoTransaction>();
     _redoStack                    = new Stack <ITextUndoTransaction>();
     _activeUndoOperationPrimitive = null;
     _state = TextUndoHistoryState.Idle;
 }