public void Unsubscribe(IProxyEventSubscriber subscriber, ProxyEventType eventType) { lock (_Subscriptions) { if (_Subscriptions.Any(c => c.Item1 == subscriber && c.Item2 == eventType)) { _Subscriptions.Remove(_Subscriptions.FirstOrDefault(c => c.Item1 == subscriber && c.Item2 == eventType)); } UpdateSubscription(); } }
public void Subscribe(IProxyEventSubscriber subscriber, ProxyEventType eventType) { lock (_Subscriptions) { if (!_Subscriptions.Any(c => c.Item1 == subscriber && c.Item2 == eventType)) { _Subscriptions.Add(new Tuple <IProxyEventSubscriber, ProxyEventType>(subscriber, eventType)); } UpdateSubscription(); } }