static void TimerCallback(object ctx) { TimerCtx _ctx = (TimerCtx)ctx; try { if (c_on_invokeLater == 0) { c_on_invokeLater = CibylCallTable.getAddressByName("rim_on_scheduledTask"); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("Exception in run (rim_on_scheduledTask): " + ex.ToString()); Logger.log(ex.ToString()); throw; //todomt //Environment.Exit(0); } if (c_on_invokeLater != 0) { UIWorker.addUIEvent(c_on_invokeLater, _ctx.index, 0, 0, 0, _ctx.interval < 100 ? true : false); } }
public static Timer schedule(int index, int interval, int repeat) { Timer timer; try { TimerCtx ctx = new TimerCtx(index, interval); timer = new Timer(TimerCallback, ctx, interval, interval);//Timeout.Infinite); } catch (Exception e) { UIWorker.addUIEventLog("Exception in scheduling task" + e); return null; } return timer; }
public static Timer schedule(int index, int interval, int repeat) { Timer timer; try { TimerCtx ctx = new TimerCtx(index, interval); timer = new Timer(TimerCallback, ctx, interval, interval);//Timeout.Infinite); } catch (Exception e) { UIWorker.addUIEventLog("Exception in scheduling task" + e.ToString()); Logger.log("Exception in scheduling task " + e.ToString()); return(null); } return(timer); }