//Our GeneratorManager event.
 protected virtual void OnNumberGenerated(BatchAndNumberInput inputDetails, BatchAndNumber batchAndNumber)
 {
     NumberGenerated?.Invoke(this, new BatchAndNumberEventArgs()
     {
         BatchAndNumber = batchAndNumber, BatchAndNumberInput = inputDetails
     });
 }
Esempio n. 2
0
        protected void OnNumberGenerated(object o)
        {
            if (_counter == _maxNumbersToGenerate)
            {
                _timer.Change(Timeout.Infinite, Timeout.Infinite);
            }

            var n = GenerateNumber();

            Interlocked.Increment(ref _counter);

            NumberGenerated?.Invoke(n);
        }