protected void OnDescriptionChanged(ClusterDescription oldDescription, ClusterDescription newDescription) { if (_descriptionChangedEventHandler != null) { _descriptionChangedEventHandler(new ClusterDescriptionChangedEvent(oldDescription, newDescription)); } var handler = DescriptionChanged; if (handler != null) { var args = new ClusterDescriptionChangedEventArgs(oldDescription, newDescription); handler(this, args); } }
protected void OnDescriptionChanged(ClusterDescription oldDescription, ClusterDescription newDescription, bool shouldClusterDescriptionChangedEventBePublished) { if (shouldClusterDescriptionChangedEventBePublished && _descriptionChangedEventHandler != null) { _descriptionChangedEventHandler(new ClusterDescriptionChangedEvent(oldDescription, newDescription)); } var handler = DescriptionChanged; if (handler != null) { var args = new ClusterDescriptionChangedEventArgs(oldDescription, newDescription); handler(this, args); } }
private void UpdateClusterDescription(ClusterDescription newClusterDescription) { var oldClusterDescription = Interlocked.CompareExchange(ref _description, newClusterDescription, _description); OnClusterDescriptionChanged(oldClusterDescription, newClusterDescription); void OnClusterDescriptionChanged(ClusterDescription oldDescription, ClusterDescription newDescription) { if (_descriptionChangedEventHandler != null) { _descriptionChangedEventHandler(new ClusterDescriptionChangedEvent(oldDescription, newDescription)); } // used only in tests and legacy var handler = DescriptionChanged; if (handler != null) { var args = new ClusterDescriptionChangedEventArgs(oldDescription, newDescription); handler(this, args); } } }