public void OnTick(TimerEventArgs e) { if (this.Tick != null) { this.Tick(this, e); } }
public void Start(int iterations) { while (iterations > 0) { TimerEventArgs arg = new TimerEventArgs(iterations); this.OnTick(arg); Thread.Sleep(this.interval); iterations--; } }
private void Timer_Tick(object sender, TimerEventArgs e) { Console.WriteLine("{0} said: \"Just {1} more times\"", this.name, e.Ticks); }