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); }
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)); }