public JintTE CreateParallelTimer(string name, int timeoutDelay, Dictionary <string, object> args) { JintTE timedEvent = new JintTE(name, (double)timeoutDelay); timedEvent.Args = args; timedEvent.OnFire += new JintTE.TimedEventFireDelegate(Plugin.OnTimerCB2); ParallelTimers.Add(timedEvent); return(timedEvent); }
public void OnTimerCB2(JintTE evt) { try { Invoke(evt.Name + "Callback", evt); } catch (Exception ex) { Fougerite.Logger.LogError("Failed to invoke callback " + evt.Name + " Ex: " + ex); } }
public void KillTimer(string name) { JintTE timer = GetTimer(name); if (timer == null) { return; } timer.Kill(); Timers.Remove(name); }
public JintTE CreateTimer(string name, int timeoutDelay) { JintTE timedEvent = GetTimer(name); if (timedEvent == null) { timedEvent = new JintTE(name, (double)timeoutDelay); timedEvent.OnFire += new JintTE.TimedEventFireDelegate(Plugin.OnTimerCB2); Timers.Add(name, timedEvent); } return(timedEvent); }