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(); }); }
public void ShowSuccess(string message, string header = "成功") { UIThread.Execute(() => { var builder = NotificationMessageBuilder.CreateMessage(Manager); builder.Success(header, message) .Dismiss() .WithDelay(TimeSpan.FromSeconds(4)) .Queue(); }); }
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 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(); } }); }
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(); } }); }
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(); } }); }
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(); } }); }
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(); } }); }
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(); } }); }