public void RemoveNotificationListener(NotificationCallback callback, NotificationFilterCallback filterCallback, object handback)
 {
     if (callback == null)
     {
         throw new ArgumentNullException("callback");
     }
     NotificationSubscription subscr = new NotificationSubscription(callback, filterCallback, handback);
     if (!_subscriptions.Remove(subscr))
     {
         throw new ListenerNotFoundException(_objectName);
     }
 }
Ejemplo n.º 2
0
        public void RemoveNotificationListener(NotificationCallback callback, NotificationFilterCallback filterCallback, object handback)
        {
            if (callback == null)
            {
                throw new ArgumentNullException("callback");
            }
            NotificationSubscription subscr = new NotificationSubscription(callback, filterCallback, handback);

            if (!_subscriptions.Remove(subscr))
            {
                throw new ListenerNotFoundException(_objectName);
            }
        }
Ejemplo n.º 3
0
        public override bool Equals(object obj)
        {
            NotificationSubscription other = obj as NotificationSubscription;

            if (other != null)
            {
                return(this._callback.Equals(other._callback) &&
                       ((this._filterCallback == null && other._filterCallback == null) ||
                        (this._filterCallback != null && other._filterCallback != null && this._filterCallback.Equals(other._filterCallback))) &&
                       ((this._handback == null && other._handback == null) ||
                        (this._handback != null && other._handback != null && this._handback.Equals(other._handback))));
            }
            return(false);
        }
 public void AddNotificationListener(NotificationCallback callback, NotificationFilterCallback filterCallback, object handback)
 {
     if (callback == null)
     {
         throw new ArgumentNullException("callback");
     }
     NotificationSubscription subscr = new NotificationSubscription(callback, filterCallback, handback);
     List<NotificationSubscription> subscrList;
     if (_subscriptions.TryGetValue(subscr, out subscrList))
     {
         subscrList.Add(subscr);
     }
     else
     {
         subscrList = new List<NotificationSubscription>();
         subscrList.Add(subscr);
         _subscriptions.Add(subscr, subscrList);
     }
 }
Ejemplo n.º 5
0
        public void AddNotificationListener(NotificationCallback callback, NotificationFilterCallback filterCallback, object handback)
        {
            if (callback == null)
            {
                throw new ArgumentNullException("callback");
            }
            NotificationSubscription        subscr = new NotificationSubscription(callback, filterCallback, handback);
            List <NotificationSubscription> subscrList;

            if (_subscriptions.TryGetValue(subscr, out subscrList))
            {
                subscrList.Add(subscr);
            }
            else
            {
                subscrList = new List <NotificationSubscription>();
                subscrList.Add(subscr);
                _subscriptions.Add(subscr, subscrList);
            }
        }