/// <inheritdoc/> public virtual void BeginTransaction() { var currentTransaction = new List <IActionItem>(); TransactionStack.Push(currentTransaction); TransactionStarted?.Invoke(this, EventArgs.Empty); }
public void MakeTransaction(Transaction transaction) { TransactionStarted?.Invoke(new TransactionEventArgs(transaction)); ProcessTransaction(transaction); TransactionDone?.Invoke(new TransactionEventArgs(transaction)); }
private void OnMakeTransactionButtonClick(object sender, EventArgs e) { if (ValidateModel()) { var transaction = CreateTransaction(); TransactionStarted?.Invoke(sender, transaction); } }
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)); }
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; } } }
/// <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); }
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); }
/// <summary> /// Starts the new drag & 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); }
public void OnTransactionStarted() { TransactionStarted?.Invoke(this, new TransactionStartedEventArgs { }); }