public WeakCollection(IEqualityComparer <T?>?comparer, bool autoRemoveDeadItems) { _comparer = comparer ?? EqualityComparer <T?> .Default; _wrapped = new ThreadSafeCollection <TNeedle>(); _eventHandler = new WeakNeedle <EventHandler>(null); if (autoRemoveDeadItems) { RegisterForAutoRemoveDeadItemsExtracted(); } else { GC.SuppressFinalize(this); } }
private static bool PrivateTryGetValue(WeakNeedle <TKey> needle, out TKey foundKey) { return(needle.TryGetValue(out foundKey)); }