コード例 #1
0
        public static NotificationRequestBuilder For(string notificationMode, 
            HealthCheckData message, 
            Action<NotificationRequest> configurer = null)
        {
            var alert = new NotificationEventHealthCheck
            {
                CheckId = message.Identity.Name,
                CriticalFailure = message.CriticalFailure,
                CriticalFailureDetails = message.CriticalFailureDetails,
                Duration = message.Duration,
                GeneratedOnUtc = message.GeneratedOnUtc,
                Message = message.Info,
                NextCheckExpected = message.NextCheckExpected,
                Properties = message.Properties,
                Result = message.Result,
                ResultCount = message.ResultCount,
                DisplayUnit = message.DisplayUnit,
                Tags = message.Tags
            };

            var builder = For(notificationMode, alert);

            if (configurer != null)
                configurer(builder._request);
            return builder;
        }
コード例 #2
0
 protected virtual void Publish(HealthCheckData message)
 {
     Messenger.Publish(NotificationRequestBuilder.For(NotificationMode, message).Build());
 }
コード例 #3
0
 public static NotificationRequestBuilder AlwaysPublish(HealthCheckData message)
 {
     return For(String.Empty, message);
 }