protected virtual void OnNumberGenerated(NumberGeneratedEventArgs e) { EventHandler <NumberGeneratedEventArgs> handler = NumberGenerated; if (handler != null) { handler(this, e); } }
internal void Run(object oGInput) { var generatorInput = (GeneratorInput)oGInput; var random = new Random(); var execution = long.Parse(DateTime.Now.ToString("yyyyMMddHHmmss")); for (int j = 0; j < generatorInput.YNumbers; j++) { //Delay System.Threading.Thread.Sleep(1000 * random.Next(MinDelay, MaxDelay)); // Generate Event NumberGeneratedEventArgs args = new NumberGeneratedEventArgs(); args.Execution = execution; args.BatchSequence = generatorInput.BatchSequence; args.Number = random.Next(MinNumber, MaxNumber); OnNumberGenerated(args); } }
void generator_NumberGenerated(object sender, NumberGeneratedEventArgs e) { number = new Number(e.Execution, e.BatchSequence, e.Number); _memoryDataManager.AddNumber(number); CallMultiplier(number); }