Ejemplo n.º 1
0
 /// <summary>
 /// 回收所有触发器,用于连接器的回收
 /// </summary>
 /// <param name="args"></param>
 public static void CollectTriggle(object[] args)
 {
     for (int i = 0; i < args.Length; i++)
     {
         UserDelegateTriggle triggle = args[i] as UserDelegateTriggle;
         if (triggle != null)
         {
             triggle.Clear();
             mTrigglePools.Enqueue(triggle);
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 调用一个异步触发器
 /// </summary>
 /// <param name="triggle"></param>
 /// <param name="bFree"></param>
 public static void Triggle(UserDelegateTriggle triggle, params object[] args)
 {
     if (triggle != null)
     {
         ///触发返回是否回收
         if (triggle.Triggle(args))
         {
             triggle.Clear();
             ///没有触发连接器的,直接回收
             mTrigglePools.Enqueue(triggle);
         }
     }
 }