public unsafe void Add <T>(EventUnsubscriber <T> unsubscriber) { var(raiser, func) = unsubscriber.GetInnerValues(); if (raiser == null || func == null) { return; } _lock.Enter(); try { _list ??= new(); _list.Add(new BagItem(&OnDispose, raiser, func)); } finally { _lock.Exit(); }
public bool Equals(EventUnsubscriber <T> other) => _raiser == other._raiser && _action == other._action;