示例#1
0
        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);
        }
示例#2
0
        //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);
                }
            }
        }
示例#3
0
 public virtual void ServiceTimerController(TTimer timer)
 {
     Execute();
 }
示例#4
0
        public void ResetTimer(Guid id)
        {
            TTimer tTimer = CloseTimer(id);

            InitTimer(tTimer.Type, tTimer.Controller, (tTimer.Interval / 1000), id);
        }