public static void Subscribe(Type type, string eventName, EventHandler listener) { string eventKey = GetEventKey(type, eventName); _listeners.AddMissing(eventKey, new HashSet <EventSubscription>()); _listeners[eventKey].Add(EventSubscription.FromEventHandler(listener)); }
public virtual void Subscribe(string eventName, EventHandler handler) { if (!_listeners.ContainsKey(eventName)) { _listeners.Add(eventName, new HashSet <EventSubscription>()); } _listeners[eventName].Add(EventSubscription.FromEventHandler(handler)); }