public static NotificationMessageBuilder WithBadgeType(this NotificationMessageBuilder builder, UINotificationType type)
        {
            switch (type)
            {
            case UINotificationType.Info:
                builder.SetBadge("Info");
                builder.Message.BadgeAccentBrush =
                    new SolidColorBrush(Color.FromRgb(2, 160, 229));
                break;

            case UINotificationType.Warning:
                builder.SetBadge("Warn");
                builder.Message.BadgeAccentBrush =
                    new SolidColorBrush(Color.FromRgb(224, 160, 48));
                break;

            case UINotificationType.Error:
                builder.SetBadge("Error");
                builder.Message.BadgeAccentBrush =
                    new SolidColorBrush(Color.FromRgb(232, 13, 0));
                break;
            }

            return(builder);
        }
        public static NotificationMessageBuilder Error(this NotificationMessageBuilder builder, string message) {
            builder
                .Accent("#1751C3")
                .Background("#F15B19")
                .HasHeader("错误");
            builder.SetMessage(message);

            return builder;
        }
 public static void ShowSuccessMessage(this INotificationMessageManager manager, string message) {
     UIThread.Execute(() => {
         var builder = NotificationMessageBuilder.CreateMessage(manager);
         builder.Success(message)
             .Dismiss()
             .WithDelay(TimeSpan.FromSeconds(4))
             .Queue();
     });
 }
示例#4
0
 public void ShowSuccess(string message, string header = "成功")
 {
     UIThread.Execute(() => {
         var builder = NotificationMessageBuilder.CreateMessage(Manager);
         builder.Success(header, message)
         .Dismiss()
         .WithDelay(TimeSpan.FromSeconds(4))
         .Queue();
     });
 }
示例#5
0
 public void ShowInfo(string message)
 {
     UIThread.Execute(() => {
         var builder = NotificationMessageBuilder.CreateMessage(Manager);
         builder.Warning(message ?? string.Empty)
         .Dismiss()
         .WithDelay(TimeSpan.FromSeconds(4))
         .Queue();
     });
 }
        public static NotificationMessageBuilder Warning(this NotificationMessageBuilder builder, string message) {
            builder
                .Accent("#1751C3")
                .Background("#FFCC00")
                .Foreground("Black")
                .HasHeader("提醒");
            builder.SetMessage(message);

            return builder;
        }
        public static NotificationMessageBuilder Success(this NotificationMessageBuilder builder, string message) {
            builder
                .Accent("#1751C3")
                .Foreground("White")
                .Background("Green")
                .HasHeader("成功");
            builder.SetMessage(message);

            return builder;
        }
示例#8
0
        public static NotificationMessageBuilder Info(this NotificationMessageBuilder builder, string header, string message)
        {
            builder
            .Accent("#1751C3")
            .Background("#D5EAFF")
            .Foreground("Black")
            .HasHeader(header);
            builder.SetMessage(message);

            return(builder);
        }
示例#9
0
        private static NotificationMessageBuilder Success(this NotificationMessageBuilder builder, string header, string message)
        {
            builder
            .Accent("#1751C3")
            .Foreground("White")
            .Background("Green")
            .HasHeader(header);
            builder.SetMessage(message);

            return(builder);
        }
 public static void ShowErrorMessage(this INotificationMessageManager manager, string message, int? delaySeconds = null) {
     UIThread.Execute(() => {
         var builder = NotificationMessageBuilder.CreateMessage(manager);
         builder.Error(message ?? string.Empty);
         if (delaySeconds.HasValue && delaySeconds.Value != 0) {
             builder
                 .Dismiss()
                 .WithDelay(TimeSpan.FromSeconds(4))
                 .Queue();
         }
         else {
             builder
                 .Dismiss().WithButton("忽略", null)
                 .Queue();
         }
     });
 }
示例#11
0
 public void ShowSuccess(string message, int autoHideSeconds, string header = "成功")
 {
     UIThread.Execute(() => {
         var builder = NotificationMessageBuilder.CreateMessage(Manager);
         builder.Success(header, message);
         if (autoHideSeconds > 0)
         {
             builder
             .Dismiss()
             .WithDelay(TimeSpan.FromSeconds(autoHideSeconds))
             .Queue();
         }
         else
         {
             builder
             .Dismiss().WithButton("知道了", null)
             .Queue();
         }
     });
 }
示例#12
0
 public void ShowInfo(string message, int autoHideSeconds)
 {
     UIThread.Execute(() => {
         var builder = NotificationMessageBuilder.CreateMessage(Manager);
         builder.Warning(message ?? string.Empty);
         if (autoHideSeconds > 0)
         {
             builder
             .Dismiss()
             .WithDelay(TimeSpan.FromSeconds(autoHideSeconds))
             .Queue();
         }
         else
         {
             builder
             .Dismiss().WithButton("知道了", null)
             .Queue();
         }
     });
 }
示例#13
0
 public void ShowError(string message, string header, int autoHideSeconds)
 {
     UIThread.Execute(() => () => {
         var builder = NotificationMessageBuilder.CreateMessage(Manager);
         builder.Error(header, message ?? string.Empty);
         if (autoHideSeconds > 0)
         {
             builder
             .Dismiss()
             .WithDelay(autoHideSeconds)
             .Queue();
         }
         else
         {
             builder
             .Dismiss().WithButton("知道了", null)
             .Queue();
         }
     });
 }
示例#14
0
 public void ShowSuccess(string message, string header, int autoHideSeconds, bool toConsole = false)
 {
     if (toConsole)
     {
         NTMinerConsole.UserOk(message);
     }
     UIThread.Execute(() => {
         var builder = NotificationMessageBuilder.CreateMessage(Manager);
         builder.Success(header, message);
         if (autoHideSeconds > 0)
         {
             builder
             .Dismiss()
             .WithDelay(autoHideSeconds)
             .Queue();
         }
         else
         {
             builder
             .Dismiss().WithButton("知道了", null)
             .Queue();
         }
     });
 }
示例#15
0
 public void ShowWarn(string message, string header, int autoHideSeconds, bool toConsole = false)
 {
     if (toConsole)
     {
         Write.UserWarn(message);
     }
     UIThread.Execute(() => () => {
         var builder = NotificationMessageBuilder.CreateMessage(Manager);
         builder.Warning(header, message ?? string.Empty);
         if (autoHideSeconds > 0)
         {
             builder
             .Dismiss()
             .WithDelay(autoHideSeconds)
             .Queue();
         }
         else
         {
             builder
             .Dismiss().WithButton("知道了", null)
             .Queue();
         }
     });
 }