void Broadcast(Container self, TrackingNotification notification) { Tracker.logger?.Log(GetName(self), $"broadcasting {notification} to subscribers"); foreach (var subscriber in trackingData.subscribers) { subscriber.target.Notify(subscriber.index, notification); } }
public void AddNotification(TrackingNotification item) { if (IsMainWindowNull() || _mainWindowViewModel.TrackingNotifications == null || _notifications == null) { return; } _notifications.Insert(0, item); RemovesUnnecessaryNotifications(); if (_notificationTypeFilters.Contains(item.Type)) { FilterNotification(); } }
public void AddNotification(TrackingNotification item) { if (IsMainWindowNull() || _mainWindowViewModel.TrackingNotifications == null || _notifications == null) { return; } _notifications.Insert(0, item); RemovesUnnecessaryNotifications(); if (_notificationTypeFilters.Contains(item.Type)) { Application.Current.Dispatcher.Invoke(delegate { _mainWindowViewModel.TrackingNotifications.Insert(0, item); }); } }
public void AddNotification(TrackingNotification item) { if (IsMainWindowNull() || _mainWindowViewModel.TrackingNotifications == null) { return; } if (_mainWindow.Dispatcher.CheckAccess()) { _mainWindowViewModel.TrackingNotifications.Insert(0, item); } else { _mainWindow.Dispatcher.Invoke(delegate { _mainWindowViewModel.TrackingNotifications.Insert(0, item); }); } RemovesUnnecessaryNotifications(); }
public void Notify(int index, TrackingNotification notification) => property.Notify(this, ref mixIn, notification);
public void Notify(Container self, ref TrackableObjectMixIn <Container> mixIn, TrackingNotification notification) { if (trackingData == null) { throw new Exception($"Expected {nameof(trackingData)} to be non-null."); } switch (notification) { case TrackingNotification.Stale: if (trackingData.staleDependencies++ == 0) { EnsureKnownAsStale(self); } break; case TrackingNotification.ReadyUnmodified: if (--trackingData.staleDependencies == 0) { HandleDependenciesStabilized(self); EnsureKnownAsStable(self, false); } break; case TrackingNotification.ReadyModified: trackingData.haveModifiedDependencies = true; if (--trackingData.staleDependencies == 0) { HandleDependenciesStabilized(self); EnsureKnownAsStable(self, true); } break; case TrackingNotification.RelaxIfAppropriate: RelaxIfAppropriate(self); break; default: throw new Exception($"Unknown notification {notification}."); } }
public void Notify(Int32 index, TrackingNotification notification) { }