Exemple #1
0
 void _RegisterBroadcasterEventTags(IBroadcaster broadcaster)
 {
     foreach (IEventTag tag in broadcaster.GetEventTags())
     {
         var entry = new EventEntry(eventTag: tag, broadcaster: broadcaster);
         AddEventEntry(entry);
     }
 }
Exemple #2
0
 public void WatchAll(IBroadcaster broadcaster)
 {
     if (broadcaster != null)
     {
         IDisposable subscription;
         subscription = broadcaster.Subscribe(this);
         if (_subscriptionsInfo.ContainsKey(broadcaster))
         {
             _RemoveSubscriptionFor(broadcaster);
         }
         if (subscription != null)
         {
             _AddSubscriptionInfo(
                 broadcaster: broadcaster,
                 subscription: subscription,
                 eventTags: broadcaster.GetEventTags()
                 );
         }
     }
 }
Exemple #3
0
        public bool IsWatchingAll(IBroadcaster broadcaster)
        {
            var isWatchingAll = false;
            SubscriptionInfo info;

            _subscriptionsInfo.TryGetValue(broadcaster, out info);
            if (info != null)
            {
                isWatchingAll = true;
                foreach (IEventTag tag in broadcaster.GetEventTags())
                {
                    if (!info.EventTags.Contains(tag))
                    {
                        isWatchingAll = false;
                        break;
                    }
                }
            }

            return(isWatchingAll);
        }