System.Windows.Forms.Timer.FireTick C# (CSharp) Method

FireTick() private method

private FireTick ( ) : void
return void
		internal void FireTick ()
		{
			OnTick (EventArgs.Empty);
		}

Usage Example

 private void CheckTimers(DateTime now)
 {
     lock (TimerList) {
         int count = TimerList.Count;
         if (count == 0)
         {
             return;
         }
         for (int i = 0; i < TimerList.Count; i++)
         {
             Timer timer = (Timer)TimerList [i];
             if (timer.Enabled && timer.Expires <= now)
             {
                 // 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.FireTick();
                     timer.Update(now);
                 }
             }
         }
     }
 }