public void OnTimerCB(TimedEvent evt) { if (Globals.Contains(evt.Name + "Callback")) { Invoke(evt.Name + "Callback", evt); } }
/// <summary> /// Creates a parallel timer. /// </summary> /// <returns>The parallel timer.</returns> /// <param name="name">Name.</param> /// <param name="timeoutDelay">Timeout delay.</param> /// <param name="args">Arguments.</param> public TimedEvent CreateParallelTimer(string name, int timeoutDelay, Dictionary <string, object> args) { TimedEvent timedEvent = new TimedEvent(name, (double)timeoutDelay); timedEvent.Args = args; timedEvent.OnFire += new TimedEvent.TimedEventFireDelegate(OnTimerCB); ParallelTimers.Add(timedEvent); return(timedEvent); }
/// <summary> /// Kills the timer. /// </summary> /// <param name="name">Name.</param> public void KillTimer(string name) { TimedEvent timer = GetTimer(name); if (timer == null) { return; } timer.Kill(); Timers.Remove(name); }
/// <summary> /// Creates a timer. /// </summary> /// <returns>The timer.</returns> /// <param name="name">Name.</param> /// <param name="timeoutDelay">Timeout delay.</param> public TimedEvent CreateTimer(string name, int timeoutDelay) { TimedEvent timedEvent = GetTimer(name); if (timedEvent == null) { timedEvent = new TimedEvent(name, (double)timeoutDelay); timedEvent.OnFire += new TimedEvent.TimedEventFireDelegate(OnTimerCB); Timers.Add(name, timedEvent); } return(timedEvent); }
/// <summary> /// Creates a timer. /// </summary> /// <returns>The timer.</returns> /// <param name="name">Name.</param> /// <param name="timeoutDelay">Timeout delay.</param> /// <param name="args">Arguments.</param> public TimedEvent CreateTimer(string name, int timeoutDelay, Dictionary <string, object> args) { TimedEvent timedEvent = GetTimer(name); if (timedEvent == null) { timedEvent = new TimedEvent(name, (double)timeoutDelay); timedEvent.Args = args; timedEvent.OnFire += new TimedEvent.TimedEventFireDelegate(OnTimerCB); Timers.Add(name, timedEvent); } return(timedEvent); }