Beispiel #1
0
 /// <summary>
 /// 停止计时器事件
 /// </summary>
 /// <param name="info"></param>
 public void StopTimerEvent(QTimerInfo info)
 {
     if (objects.Contains(info) && info != null)
     {
         info.stop = true;
     }
 }
Beispiel #2
0
 /// <summary>
 /// 删除计时器事件
 /// </summary>
 /// <param name="name"></param>
 public void RemoveTimerEvent(QTimerInfo info)
 {
     if (objects.Contains(info) && info != null)
     {
         info.delete = true;
     }
 }
Beispiel #3
0
 /// <summary>
 /// 添加计时器事件
 /// </summary>
 /// <param name="name"></param>
 /// <param name="o"></param>
 public void AddTimerEvent(QTimerInfo info)
 {
     if (!objects.Contains(info))
     {
         objects.Add(info);
     }
 }
Beispiel #4
0
 /// <summary>
 /// 计时器运行
 /// </summary>
 void Run()
 {
     if (objects.Count == 0)
     {
         return;
     }
     for (int i = 0; i < objects.Count; i++)
     {
         QTimerInfo o = objects[i];
         if (o.delete || o.stop)
         {
             continue;
         }
         ITimerBehaviour timer = o.target as ITimerBehaviour;
         timer.TimerUpdate();
         o.tick++;
     }
     /////////////////////////清除标记为删除的事件///////////////////////////
     for (int i = objects.Count - 1; i >= 0; i--)
     {
         if (objects[i].delete)
         {
             objects.Remove(objects[i]);
         }
     }
 }
Beispiel #5
0
 /// <summary>
 /// 继续计时器事件
 /// </summary>
 /// <param name="info"></param>
 public void ResumeTimerEvent(QTimerInfo info)
 {
     if (objects.Contains(info) && info != null)
     {
         info.delete = false;
     }
 }
Beispiel #6
0
 /// <summary>
 /// 删除计时器事件
 /// </summary>
 /// <param name="name"></param>
 public void RemoveTimerEvent(QTimerInfo info) {
     if (objects.Contains(info) && info != null) {
         info.delete = true;
     }
 }
Beispiel #7
0
 /// <summary>
 /// 添加计时器事件
 /// </summary>
 /// <param name="name"></param>
 /// <param name="o"></param>
 public void AddTimerEvent(QTimerInfo info) {
     if (!objects.Contains(info)) {
         objects.Add(info);
     }
 }
Beispiel #8
0
 /// <summary>
 /// 继续计时器事件
 /// </summary>
 /// <param name="info"></param>
 public void ResumeTimerEvent(QTimerInfo info) {
     if (objects.Contains(info) && info != null) {
         info.delete = false;
     }
 }
Beispiel #9
0
 /// <summary>
 /// 停止计时器事件
 /// </summary>
 /// <param name="info"></param>
 public void StopTimerEvent(QTimerInfo info) {
     if (objects.Contains(info) && info != null) {
         info.stop = true;
     }
 }