Esempio n. 1
0
        private void OnTransactionChangedHandler(object sender, NotifyTransactionChangedEventArgs e)
        {
            if (e.Action == NotifyTransactionChangedAction.Commit)
            {
                var    allEvents       = changeCollector.GetAllChanges();
                var    transactionMock = new TransactionMock(e.Transaction.TransactionId, e.Transaction.CommitSequenceNumber);
                var    trAppliedEvent  = new NotifyTransactionAppliedEvent(transactionMock, allEvents);
                Byte[] byteStream      = messageConverter.Serialize(trAppliedEvent);
                long   currentLsn      = e.Transaction.CommitSequenceNumber;
                // handle the failure of Task here.
                EventCollector.TransactionApplied(this.partitionId, previousLsn, currentLsn, byteStream);
                previousLsn = currentLsn;

                // Flush previous items.
                this.changeCollector.CreateNew();
            }
        }
 public NotifyDictionaryTransactionalEventArgsMock(TransactionMock transaction, NotifyDictionaryChangedAction action) : base(action)
 {
     this.transaction = transaction;
 }
 public NotifyDictionaryItemAddedEventArgsMock(TransactionMock transaction, TKey key, TValue value) : base(transaction, NotifyDictionaryChangedAction.Add)
 {
     this.Key   = key;
     this.Value = value;
 }
Esempio n. 4
0
 public NotifyDictionaryItemRemovedEventArgsMock(TransactionMock transaction, TKey key) : base(transaction, NotifyDictionaryChangedAction.Add)
 {
     this.Key = key;
 }
Esempio n. 5
0
 public NotifyTransactionAppliedEvent(TransactionMock transaction, List <ReliableCollectionChange> changes)
 {
     this.Transaction = transaction;
     this.Changes     = changes;
 }