private ImmutableArray <Registry <TEventHandler> > GetRegistries_NoLock <TEventHandler>(string eventName) where TEventHandler : class { _guard.AssertHasLock(); if (_eventNameToRegistries.TryGetValue(eventName, out var registries)) { return((ImmutableArray <Registry <TEventHandler> >)registries); } return(ImmutableArray.Create <Registry <TEventHandler> >()); }
private ImmutableArray <TEventHandler> GetEvents_NoLock <TEventHandler>(string eventName) { _guard.AssertHasLock(); object handlers; if (_eventNameToHandlers.TryGetValue(eventName, out handlers)) { return((ImmutableArray <TEventHandler>)handlers); } return(ImmutableArray.Create <TEventHandler>()); }