Beispiel #1
0
 /// <inheritdoc/>
 public void Dispose()
 {
     dirtyingOperationsMap.Clear();
     transactionStack.TransactionCompleted     -= TransactionCompleted;
     transactionStack.TransactionRollbacked    -= TransactionStatusChanged;
     transactionStack.TransactionRollforwarded -= TransactionStatusChanged;
     transactionStack.TransactionDiscarded     -= TransactionDiscarded;
     transactionStack.Cleared -= StackCleared;
     transactionStack          = null;
 }
 /// <inheritdoc/>
 public void Dispose()
 {
     dirtyingOperationsMap.Clear();
     transactionStack.TransactionCompleted -= TransactionCompleted;
     transactionStack.TransactionRollbacked -= TransactionStatusChanged;
     transactionStack.TransactionRollforwarded -= TransactionStatusChanged;
     transactionStack.TransactionDiscarded -= TransactionDiscarded;
     transactionStack.Cleared -= StackCleared;
     transactionStack = null;
 }
 /// <summary>
 /// Initializes a new instance of the <seealso cref="DirtiableManager"/> class.
 /// </summary>
 /// <param name="transactionStack"></param>
 public DirtiableManager(ITransactionStack transactionStack)
 {
     if (transactionStack == null) throw new ArgumentNullException(nameof(transactionStack));
     this.transactionStack = transactionStack;
     transactionStack.TransactionCompleted += TransactionCompleted;
     transactionStack.TransactionRollbacked += TransactionStatusChanged;
     transactionStack.TransactionRollforwarded += TransactionStatusChanged;
     transactionStack.TransactionDiscarded += TransactionDiscarded;
     transactionStack.Cleared += StackCleared;
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <seealso cref="DirtiableManager"/> class.
 /// </summary>
 /// <param name="transactionStack"></param>
 public DirtiableManager([NotNull] ITransactionStack transactionStack)
 {
     if (transactionStack == null)
     {
         throw new ArgumentNullException(nameof(transactionStack));
     }
     this.transactionStack = transactionStack;
     transactionStack.TransactionCompleted     += TransactionCompleted;
     transactionStack.TransactionRollbacked    += TransactionStatusChanged;
     transactionStack.TransactionRollforwarded += TransactionStatusChanged;
     transactionStack.TransactionDiscarded     += TransactionDiscarded;
     transactionStack.Cleared += StackCleared;
 }
Beispiel #5
0
 public UndoRedoService(int stackCapacity)
 {
     stack = TransactionStackFactory.Create(stackCapacity);
     dirtiableManager = new DirtiableManager(stack);
 }
Beispiel #6
0
 public UndoRedoService(int stackCapacity)
 {
     stack = TransactionStackFactory.Create(stackCapacity);
     stack.TransactionCompleted += TransactionCompleted;
     dirtiableManager            = new DirtiableManager(stack);
 }