Пример #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
 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
 public void OnTransactionStarted()
 {
     TransactionStarted?.Invoke(this, new TransactionStartedEventArgs {
     });
 }