Exemple #1
0
 public void AddEventHandler <TEventHandler>(string eventName, TEventHandler eventHandler)
 {
     using (_guard.DisposableWait())
     {
         var handlers    = GetEvents_NoLock <TEventHandler>(eventName);
         var newHandlers = handlers.Add(eventHandler);
         SetEvents_NoLock(eventName, newHandlers);
     }
 }
Exemple #2
0
 public void AddEventHandler <TEventHandler>(string eventName, TEventHandler eventHandler)
     where TEventHandler : class
 {
     using (_guard.DisposableWait())
     {
         var registries    = GetRegistries_NoLock <TEventHandler>(eventName);
         var newRegistries = registries.Add(new Registry <TEventHandler>(eventHandler));
         SetRegistries_NoLock(eventName, newRegistries);
     }
 }