Ejemplo n.º 1
0
 /// <summary>
 /// 增加一个
 /// </summary>
 /// <param name="item"></param>
 public static void Add(TimerCallItem item)
 {
     lock (m_worklist) {
         item.watch.Start();
         m_worklist.AddLast(item);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="name"></param>
        /// <param name="callType"></param>
        /// <param name="delay">延时</param>
        /// <param name="callback"></param>
        public static void Add(string name, TimerCallType callType, int delay, Action <TimerCallItem> callback)
        {
            TimerCallItem item = new TimerCallItem {
                Name = name, CallType = callType, Timestamp = DateTime.Now, Delay = delay, Callback = callback
            };

            Add(item);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="name"></param>
 /// <param name="callType"></param>
 /// <param name="delay">延时</param>
 /// <param name="callback"></param>
 public static void Add(string name, TimerCallType callType, int delay, Action<TimerCallItem> callback)
 {
     TimerCallItem item = new TimerCallItem { Name = name, CallType = callType, Timestamp = DateTime.Now, Delay = delay, Callback = callback };
     Add(item);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 增加一个
 /// </summary>
 /// <param name="item"></param>
 public static void Add(TimerCallItem item)
 {
     lock (m_worklist) {
         item.watch.Start();
         m_worklist.AddLast(item);
     }
 }