Esempio n. 1
0
        public void ExecuteTransaction(Guid sessionId, TransactionalMappingToolServiceClient serviceProxy)
        {
            if (TransactionExecuting != null)
            {
                System.EventArgs emptyEventArgs = new System.EventArgs();
                TransactionExecuting(this, emptyEventArgs);
            }

            ISoapTransactionLinkExecutor executor = Start;

            if (!_onCompletedBound)
            {
                LastLink.AddNextLink(End);

                executor.TransactionFailed    += OnTransactionFailed;
                executor.TransactionCompleted += OnTransactionCompleted;

                _onCompletedBound = true;
            }

            if (IsBulkChain)
            {
                Service.OPS bulkOperations = new Service.OPS();

                executor.ExecuteBulkTransactions(sessionId, serviceProxy, ref bulkOperations);
            }
            else
            {
                executor.ExecuteTransaction(sessionId, serviceProxy);
            }
        }
Esempio n. 2
0
 public void AddTransaction(ISoapTransactionLink transaction)
 {
     NumberOfTransactions++;
     transaction.TransactionLinkId = NumberOfTransactions;
     transaction.OriginChain       = this;
     Transactions.Add(transaction.TransactionLinkId, transaction);
     LastLink.AddNextLink(transaction);
     LastLink = transaction;
 }
Esempio n. 3
0
        /// <summary> Returns a <see cref="String"/> that represents this instance. </summary>
        /// <returns> A <see cref="String"/> that represents this instance. </returns>
        public override string ToString()
        {
            Contract.Ensures(Contract.Result <string>() != null);

            return(LastLink.ToString());
        }
Esempio n. 4
0
 /// <summary> Rolls the dice chain once and accumulates step-by-step roll data for each chain node.
 /// It's not as efficient as usual <see cref="Roll()"/> methods and should be used only if
 /// individual roll values are needed. </summary>
 /// <remarks>This method allocates an array per dice chain node.</remarks>
 /// <param name="steps">Roll values of each step of the dice chain. Steps in dice chain go from left to right.
 /// </param>
 /// <returns>Value of a single roll.</returns>
 public double RollStepByStep(out List <DiceChainRollStep> steps)
 {
     return(LastLink.RollStepByStep(out steps));
 }
Esempio n. 5
0
 /// <summary> Performs a specified amount of rolls of the entire chain and returns their values. </summary>
 /// <param name="count">The chain roll count.</param>
 /// <returns> Entire chain roll values. </returns>
 /// <remarks> Business as usual with generated enumerations: keep in mind that it will regenerate roll values
 /// every time you enumerate, so call something like '.ToArray()' when you want to keep previous values.
 /// </remarks>
 public IEnumerable <double> Roll(int count)
 {
     return(LastLink.Roll(count));
 }
Esempio n. 6
0
 /// <summary> Performs a single roll of the entire chain and returns its value. </summary>
 /// <returns> Entire chain roll value. </returns>
 public double Roll()
 {
     return(LastLink.Roll());
 }