/// <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; }
/// <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; }
public UndoRedoService(int stackCapacity) { stack = TransactionStackFactory.Create(stackCapacity); dirtiableManager = new DirtiableManager(stack); }
public UndoRedoService(int stackCapacity) { stack = TransactionStackFactory.Create(stackCapacity); stack.TransactionCompleted += TransactionCompleted; dirtiableManager = new DirtiableManager(stack); }