public TTimer CloseTimer(Guid id) { TTimer tTimer = new TTimer(); if (!TickTimers.ContainsKey(id)) { return(tTimer); } tTimer = (TTimer)TickTimers[id]; tTimer.CloseTimer(); TickTimers.Remove(id); return(tTimer); }
//System.Timers.Timer EventHandler private void Timer_Elapsed(object sender, ElapsedEventArgs e) { try { TTimer timer = TickTimers.Values.Single(item => (((TTimer)item).Type == ETimerType.System) && ((System.Timers.Timer)((TTimer)item).Timer).Equals((System.Timers.Timer)sender)); timer.Controller(timer); } catch (Exception ex) { if (IsLogEnabled) { MyLogger.LogText(ex.Message); } } }
public virtual void ServiceTimerController(TTimer timer) { Execute(); }
public void ResetTimer(Guid id) { TTimer tTimer = CloseTimer(id); InitTimer(tTimer.Type, tTimer.Controller, (tTimer.Interval / 1000), id); }