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; }
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); }
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); }
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; }
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); }
public AutomationProfile Run(INotificationEventPublisher plugin) { _publisherLoader.Add(plugin); return(this); }
protected abstract bool ShouldPublish(INotificationEventPublisher publisher, NotificationEvent message);
public AutomationProfile Run(INotificationEventPublisher plugin) { _publisherLoader.Add(plugin); return this; }