private void WhenLapEnd(HoldingValues e) { if (ValueHolder != null) { ValueHolder(this, e); } }
/// <summary> /// Run procceds here /// </summary> public void Racing() { HoldingValues values = new HoldingValues(); values.Name = Thread.CurrentThread.Name; for (int i = 0; i < 5; i++) { Accident(Thread.CurrentThread); values.Laps = i; values.Time = stopwatch.Elapsed; WhenLapEnd(values); Thread.Sleep(5000); } }