示例#1
0
 protected override bool ShouldPublish(INotificationEventPublisher publisher, NotificationEvent message)
 {
     if (PublishFailure && !message.Result.GetValueOrDefault(false))
         return true;
     if (PublishSuccess && message.Result.GetValueOrDefault(false))
         return true;
     return false;
 }
示例#2
0
 protected override bool ShouldPublish(INotificationEventPublisher publisher, NotificationEvent message)
 {
     if (PublishFailure && !message.Result.GetValueOrDefault(false))
     {
         return(true);
     }
     if (PublishSuccess && message.Result.GetValueOrDefault(false))
     {
         return(true);
     }
     return(false);
 }
示例#3
0
        protected bool Applies(INotificationEventPublisher publisher, NotificationEvent message)
        {
            if ((message == null) || (publisher == null))
            {
                return(false);
            }

            var publisherMatch = ((System.String.Compare(publisher.FriendlyId, Publisher, System.StringComparison.OrdinalIgnoreCase) == 0) ||
                                  (System.String.Compare(Publisher, "*", System.StringComparison.OrdinalIgnoreCase) == 0));
            var checkMatch = ((System.String.Compare(message.CheckId, Check, System.StringComparison.OrdinalIgnoreCase) == 0) ||
                              (System.String.Compare(Check, "*", System.StringComparison.OrdinalIgnoreCase) == 0));

            return(publisherMatch && checkMatch);
        }
示例#4
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;
        }
示例#5
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);
        }
示例#6
0
 public AutomationProfile Run(INotificationEventPublisher plugin)
 {
     _publisherLoader.Add(plugin);
     return(this);
 }
示例#7
0
 protected abstract bool ShouldPublish(INotificationEventPublisher publisher,
                                       NotificationEvent message);
 public AutomationProfile Run(INotificationEventPublisher plugin)
 {
     _publisherLoader.Add(plugin);
     return this;
 }