コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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);
                }
            }
        }
コード例 #4
0
        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);
            }
        }