コード例 #1
0
        internal Notification CreateNotification(NotificationVersionOne v1Notification)
        {
            Notification notification = null;

            if (v1Notification != null)
            {
                notification = new Notification
                {
                    Exception        = CreateExceptionData(v1Notification.Exception),
                    Id               = v1Notification.Id,
                    Level            = Utilities.CreateFailureLevel(v1Notification.Level),
                    Message          = CreateMessage(v1Notification.Message),
                    PhysicalLocation = CreatePhysicalLocation(v1Notification.PhysicalLocation),
                    Properties       = v1Notification.Properties,
                    RuleId           = v1Notification.RuleId,
                    ThreadId         = v1Notification.ThreadId,
                    TimeUtc          = v1Notification.Time
                };
            }

            return(notification);
        }
コード例 #2
0
        internal NotificationVersionOne CreateNotificationVersionOne(Notification v2Notification)
        {
            NotificationVersionOne notification = null;

            if (v2Notification != null)
            {
                notification = new NotificationVersionOne
                {
                    Exception        = CreateExceptionDataVersionOne(v2Notification.Exception),
                    Id               = v2Notification.Id,
                    Level            = Utilities.CreateNotificationLevelVersionOne(v2Notification.Level),
                    Message          = v2Notification.Message?.Text,
                    PhysicalLocation = CreatePhysicalLocationVersionOne(v2Notification.PhysicalLocation),
                    Properties       = v2Notification.Properties,
                    RuleId           = v2Notification.RuleId,
                    ThreadId         = v2Notification.ThreadId,
                    Time             = v2Notification.TimeUtc
                };
            }

            return(notification);
        }
コード例 #3
0
        internal Notification CreateNotification(NotificationVersionOne v1Notification)
        {
            Notification notification = null;

            if (v1Notification != null)
            {
                notification = new Notification
                {
                    Exception  = CreateExceptionData(v1Notification.Exception),
                    Level      = Utilities.CreateFailureLevel(v1Notification.Level),
                    Message    = CreateMessage(v1Notification.Message),
                    Locations  = CreateLocations(v1Notification.PhysicalLocation),
                    Properties = v1Notification.Properties,
                    ThreadId   = v1Notification.ThreadId,
                    TimeUtc    = v1Notification.Time
                };

                if (!string.IsNullOrWhiteSpace(v1Notification.Id))
                {
                    notification.Descriptor = new ReportingDescriptorReference
                    {
                        Id = v1Notification.Id,
                    };
                }

                if (!string.IsNullOrWhiteSpace(v1Notification.RuleId))
                {
                    notification.AssociatedRule = new ReportingDescriptorReference
                    {
                        Id = v1Notification.RuleId,
                    };
                }
            }

            return(notification);
        }