Esempio n. 1
0
 public static void Detach(WeakTimer t)
 {
     for (int i = _listeners.Count - 1; i >= 0; i--)
     {
         WeakReference wr = (WeakReference)_listeners[i];
         try
         {
             if (wr.Target == t)
             {
                 _listeners.RemoveAt(i);
             }
         }
         catch
         {
         }
     }
 }
Esempio n. 2
0
        public static void Attach(WeakTimer t)
        {
            WeakReference wr = new WeakReference(t);

            _listeners.Add(wr);
        }