Beispiel #1
0
        /// <summary>
        /// 停止计时器
        /// </summary>
        /// <param name="timerKey">Timer key.</param>
        public static void StopTimer(string timerKey)
        {
            if (!mTimerTaskMap.ContainsKey(timerKey))
            {
                return;
            }
            TimerTask timerItem = mTimerTaskMap[timerKey];

            if (timerItem != null)
            {
                timerItem.Stop(true);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 移除计时器
        /// </summary>
        /// <param name="timeKey"></param>
        public static void UnRegister(string timeKey)
        {
            if (!mTimerTaskMap.ContainsKey(timeKey))
            {
                return;
            }
            TimerTask timerTask = mTimerTaskMap[timeKey];

            if (timerTask != null)
            {
                timerTask.Stop(true);
                timerTask = null;
                mTimerTaskMap.Remove(timeKey);
            }
        }