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));
        }
 public MockTextUndoHistory(MockTextUndoHistoryRegistry undoHistoryRegistry)
 {
     _currentTransaction           = null;
     UndoHistoryRegistry           = undoHistoryRegistry;
     _undoStack                    = new Stack <ITextUndoTransaction>();
     _redoStack                    = new Stack <ITextUndoTransaction>();
     _activeUndoOperationPrimitive = null;
     _state = TextUndoHistoryState.Idle;
 }