void P_EH_Item_AfterDisposed(object sender, DisposeEventArgs eventArgs) { eventArgs.EnsureNotNull(nameof(eventArgs)); // if (eventArgs.ExplicitDispose) { Dispose(); } }
void P_EH_Key_AfterDisposed(object sender, DisposeEventArgs eventArgs, P_ValueHolder valueHolder) { var key = sender.EnsureNotNull(nameof(sender)).EnsureOfType <TKey>().Value; eventArgs.EnsureNotNull(nameof(eventArgs)); valueHolder.EnsureNotNull(nameof(valueHolder)); // itrlck .Update( location: ref _innerTable, transform: (ImmutableDictionary <TKey, P_ValueHolder> locCurrent) => { var locChanged = locCurrent; if (ImmutableInterlocked.TryRemove(location: ref locChanged, key: key, value: out var locRemoving) && ReferenceEquals(valueHolder, locRemoving)) { return(locChanged); }