private void CheckTimers (ArrayList timers, DateTime now) {
int count;
count = timers.Count;
if (count == 0)
return;
for (int i = 0; i < timers.Count; i++) {
Timer timer;
timer = (Timer) timers [i];
if (timer.Enabled && timer.Expires <= now && !timer.Busy) {
// Timer ticks:
// - Before MainForm.OnLoad if DoEvents () is called.
// - After MainForm.OnLoad if not.
//
if (in_doevents ||
(Application.MWFThread.Current.Context != null &&
(Application.MWFThread.Current.Context.MainForm == null ||
Application.MWFThread.Current.Context.MainForm.IsLoaded))) {
timer.Busy = true;
timer.Update (now);
timer.FireTick ();
timer.Busy = false;
}
}
}
}