protected virtual void OnNumberMultiplied(NumberMultipliedEventArgs e)
        {
            EventHandler <NumberMultipliedEventArgs> handler = NumberMultiplied;

            if (handler != null)
            {
                handler(this, e);
            }
        }
        internal void Run(object oNumber)
        {
            var random = new Random();
            var number = (Number)oNumber;

            //Delay
            System.Threading.Thread.Sleep(1000 * random.Next(MinDelay, MaxDelay));
            // Generate Event
            NumberMultipliedEventArgs args = new NumberMultipliedEventArgs();

            args.Execution     = number.Execution;
            args.BatchSequence = number.BatchSequence;
            args.Number        = number.Value;
            args.Total         = random.Next(MinMultiplier, MaxMultiplier) * number.Value;
            OnNumberMultiplied(args);
        }
Beispiel #3
0
 void multiplier_NumberMultiplied(object sender, NumberMultipliedEventArgs e)
 {
     number = new Number(e.Execution, e.BatchSequence, e.Number, e.Total);
     _memoryDataManager.UpdateNumber(number);
     _memoryDataManager.DecrementRemainingNumbers();
 }