Example #1
0
 public static bool Remove <T>(WeakList <T> list, T element) where T : class
 {
     if (element == null)
     {
         return(false);
     }
     if (list != null)
     {
         return(list.Remove(element));
     }
     return(false);
 }
Example #2
0
        public bool RemoveSub(TPub pub, TSub sub)
        {
            if (_InstanceSubscribers == null)
            {
                return(false);
            }
            int             pubHash = pub.GetHashCode();
            WeakList <TSub> subs    = null;

            if (!_InstanceSubscribers.TryGetValue(pubHash, out subs))
            {
                return(false);
            }
            return(subs.Remove(sub));
        }