public static void Unsubscribe(IGlobalSubscriber subscriber) { List <Type> subscribersTypes = EventsHandlerHelper.GetSubscriberTypes(subscriber); foreach (Type type in subscribersTypes) { if (_subscribers.ContainsKey(type)) { _subscribers[type].Remove(subscriber); } } }
public static void Subscribe(IGlobalSubscriber subscriber) { List <Type> subscribersTypes = EventsHandlerHelper.GetSubscriberTypes(subscriber); foreach (Type type in subscribersTypes) { if (!_subscribers.ContainsKey(type)) { _subscribers[type] = new SubscribersList <IGlobalSubscriber>(); } _subscribers[type].Add(subscriber); } }