void _RegisterBroadcasterEventTags(IBroadcaster broadcaster) { foreach (IEventTag tag in broadcaster.GetEventTags()) { var entry = new EventEntry(eventTag: tag, broadcaster: broadcaster); AddEventEntry(entry); } }
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() ); } } }
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); }