Пример #1
0
        private void InvokeNotification(QueryNotification notification)
        {
            Debug.Assert(notification != null);
            Debug.Assert(notification.Name != null);
            Debug.Assert(!string.IsNullOrWhiteSpace(notification.Name));

            if (_subscriptions.Count == 0)
            {
                return; // going short here
            }
            var notName = NormalizeNotificationName(notification.Name);

            if (_subscriptions.ContainsKey(notName))
            {
                var cbs = _subscriptions[notName];
                for (int i = 0; i < cbs.Count; ++i)
                {
                    var cb = cbs[i];
                    if (cb != null)
                    {
                        cb(notification.Data);
                    }
                }
            }
        }
Пример #2
0
        private void InvokeNotification(QueryNotification notification)
        {
            Debug.Assert(notification != null);
            Debug.Assert(notification.Name != null);
            Debug.Assert(!string.IsNullOrWhiteSpace(notification.Name));

            if (_subscriptions.Count == 0)
                return; // going short here

            var notName = NormalizeNotificationName(notification.Name);
            if (_subscriptions.ContainsKey(notName))
            {
                var cbs = _subscriptions[notName];
                for (int i = 0; i < cbs.Count; ++i)
                {
                    var cb = cbs[i];
                    if (cb != null)
                        cb(notification.Data);
                }
            }
        }