コード例 #1
0
        /// <inheritdoc/>
        public virtual void BeginTransaction()
        {
            var currentTransaction = new List <IActionItem>();

            TransactionStack.Push(currentTransaction);
            TransactionStarted?.Invoke(this, EventArgs.Empty);
        }
コード例 #2
0
        public void MakeTransaction(Transaction transaction)
        {
            TransactionStarted?.Invoke(new TransactionEventArgs(transaction));

            ProcessTransaction(transaction);

            TransactionDone?.Invoke(new TransactionEventArgs(transaction));
        }
コード例 #3
0
        private void OnMakeTransactionButtonClick(object sender, EventArgs e)
        {
            if (ValidateModel())
            {
                var transaction = CreateTransaction();

                TransactionStarted?.Invoke(sender, transaction);
            }
        }
コード例 #4
0
        public void Start()
        {
            if (Status != DeltaTransactionStatus.Unknown)
            {
                throw new Exception(string.Format("Transaction in status {0}", Status));
            }

            Status = DeltaTransactionStatus.Active;
            TransactionStarted?.Invoke(this, new DeltaTransactionEventArgs(this));
        }
コード例 #5
0
ファイル: CustomerViewModel.cs プロジェクト: gvhung/shop
 public void Handle(TransactionStarted message)
 {
     if (Object.Equals(ActiveItem, message.Source))
     {
         foreach (var item in Items.Where(o => !o.IsActive).OfType <IEnabled>())
         {
             item.IsEnabled = false;
         }
     }
 }
コード例 #6
0
 /// <inheritdoc/>
 public void BeginTransaction()
 {
     lock (_lock)
     {
         if (Transaction != null)
         {
             throw new ApplicationException("There is already a transaction. Use CreateSavePoint instead of nested transactions.");
         }
         Transaction = Connection.BeginTransaction();
     }
     TransactionStarted?.Invoke(this, null);
 }
コード例 #7
0
 public void StartTransaction(T item, string identifier, int index, Func <Task> commitCallback, Func <Task> cancelCallback)
 {
     _transaction = new MudDragAndDropItemTransaction <T>(item, identifier, index, commitCallback, cancelCallback);
     TransactionStarted?.Invoke(this, _transaction);
 }
コード例 #8
0
        /// <summary>
        /// Starts the new drag &amp; drop transaction for the specified item and dropzone.
        /// </summary>
        /// <param name="item">Item that is being dragged.</param>
        /// <param name="sourceZoneName">Dropzone name that is the source of the drag operation.</param>
        /// <param name="commited">Callback that will be called after the successful transaction.</param>
        /// <param name="canceled">Callback that will be called when the transaction has been cancelled.</param>
        public void StartTransaction(TItem item, string sourceZoneName, Func <Task> commited, Func <Task> canceled)
        {
            transaction = new DraggableTransaction <TItem>(item, sourceZoneName, commited, canceled);

            TransactionStarted?.Invoke(this, transaction);
        }
コード例 #9
0
ファイル: SqlService.cs プロジェクト: armandong/MiniORM
 public void OnTransactionStarted()
 {
     TransactionStarted?.Invoke(this, new TransactionStartedEventArgs {
     });
 }