public void UpdateApplication(Carteira carteira, MonteCarlo mc, int countLoops, int totalLoops) { UpdatesToAdd updt = new UpdatesToAdd(); updt.carteira = carteira; updt.mc = mc; updt.countLoops = countLoops; updt.totalLoops = gpRunner.pool.iterationNumber; updatesToAdd.Add(updt); }
private int UpdateThreadTick(int runs) { Application.DoEvents(); if (updatesToAdd.Count > 0) { int count = updatesToAdd.Count; for (int i = 0; i < count; i++) { UpdatesToAdd updt = updatesToAdd[i]; runs++; if (updt != null) { configController.UpdateApplication(updt.carteira, updt.mc, runs, updt.totalLoops); } } updatesToAdd.Clear(); } return(runs); }