コード例 #1
0
        protected override bool ShouldPublish(INotificationEventPublisher publisher, NotificationEvent message)
        {
            if (IgnoreTheseTypes != null && IgnoreTheseTypes.Count > 0)
            {
                // don't publish if match
                if (IgnoreTheseTypes.Exists(ignoreType => System.String.CompareOrdinal(ignoreType, message.EventType) == 0))
                {
                    return(false);
                }
                // otherwise check the publish list next....
            }

            if (PublishTheseTypes != null && PublishTheseTypes.Count > 0)
            {
                // publish only if match
                return(PublishTheseTypes.Exists(publishType => System.String.CompareOrdinal(publishType, message.EventType) == 0));
            }

            // publish everything else...
            return(true);
        }
コード例 #2
0
        protected override bool ShouldPublish(IHealthCheckResultPublisher publisher, HealthCheckResult message)
        {
            if (IgnoreTheseTypes != null && IgnoreTheseTypes.Count > 0)
            {
                // don't publish if match
                if (IgnoreTheseTypes.Exists(ignoreType => string.Compare(ignoreType, message.EventType) == 0))
                {
                    return(false);
                }
                // otherwise check the publish list next....
            }

            if (PublishTheseTypes != null && PublishTheseTypes.Count > 0)
            {
                // publish only if match
                return(PublishTheseTypes.Exists(publishType => string.Compare(publishType, message.EventType) == 0));
            }

            // publish everything else...
            return(true);
        }