Exemplo n.º 1
0
        protected override IDistributedNotification ToDistributedNotification(INotification notification)
        {
            var distributedNotification = new DistributedNotification
            {
                Title                 = notification.DisplayTitle,
                Content               = notification.DisplayContent,
                AppIconUrl            = AppIconPath(notification.Status),
                NotificationType      = ToDistributedNotificationType(notification.Type),
                NotificationErrorType = ToDistributedErrorType(notification.Status),
                IssueSource           = notification.IssueSource,
                Source                = notification.Source,
                BasedOnNotification   = notification.Guid
            };

            var statusToColorConverter = BuildStatusToBrushConverter.Instance;
            var brushFromStatus        = statusToColorConverter.Convert(notification.Status) as SolidColorBrush ?? statusToColorConverter.DefaultBrush;

            distributedNotification.ColorCode = brushFromStatus.Color.ToUintColor();

            distributedNotification.ContentImageUrl   = CreateNotificationImage(distributedNotification);
            distributedNotification.FeedbackArguments = distributedNotification.ToUriProtocol();

            Log.Debug().Message($"Created Feedback Argument for notification \"{distributedNotification.FeedbackArguments}\".").Write();
            return(distributedNotification);
        }