Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
        public void KillTimer(string name)
        {
            JintTE timer = GetTimer(name);

            if (timer == null)
            {
                return;
            }

            timer.Kill();
            Timers.Remove(name);
        }
Esempio n. 4
0
        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);
        }