From d1613f40d2838049fb765e3bfdfc2e2f186b3c18 Mon Sep 17 00:00:00 2001 From: Sunny Date: Mon, 26 Aug 2024 11:32:35 +0800 Subject: [PATCH] =?UTF-8?q?*=20UIMessageBox:=20UIMessageBox=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BA=86=E5=BF=AB=E6=8D=B7=E8=B0=83=E7=94=A8UIMessage?= =?UTF-8?q?Form2=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Forms/UIFormHelper.cs | 37 ++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/SunnyUI/Forms/UIFormHelper.cs b/SunnyUI/Forms/UIFormHelper.cs index b640d76b..a07aa4a7 100644 --- a/SunnyUI/Forms/UIFormHelper.cs +++ b/SunnyUI/Forms/UIFormHelper.cs @@ -96,7 +96,7 @@ namespace Sunny.UI public static void ShowInfo(string message, bool showMask = false, int delay = 0) { - Show(message, UILocalize.InfoTitle, UIStyle.Gray, UIMessageBoxButtons.OK, showMask, delay); + Show(message, UILocalize.InfoTitle, UIStyles.Style, UIMessageBoxButtons.OK, showMask, delay); } public static void ShowSuccess(string message, bool showMask = false, int delay = 0) @@ -135,10 +135,41 @@ namespace Sunny.UI /// 默认按钮 /// 消息停留时长(ms)。默认1秒 /// 结果 - public static bool ShowMessageDialog(string message, string title, bool showCancelButton, UIStyle style, + public static bool ShowMessageDialog(string message, string title, bool showCancel, UIStyle style, bool showMask = false, UIMessageDialogButtons defaultButton = UIMessageDialogButtons.Ok, int delay = 0) { - return ShowMessageDialog(null, message, title, showCancelButton, style, showMask, defaultButton, delay); + return ShowMessageDialog(null, message, title, showCancel, style, showMask, defaultButton, delay); + } + + public static void ShowInfo2(string message, bool showMask = false, int delay = 0) + { + ShowMessageDialog2(UILocalize.InfoTitle, message, UINotifierType.INFO, showMask, UIMessageDialogButtons.Ok, delay); + } + + public static void ShowSuccess2(string message, bool showMask = false, int delay = 0) + { + ShowMessageDialog2(UILocalize.SuccessTitle, message, UINotifierType.OK, showMask, UIMessageDialogButtons.Ok, delay); + } + + public static void ShowWarning2(string message, bool showMask = false, int delay = 0) + { + ShowMessageDialog2(UILocalize.WarningTitle, message, UINotifierType.WARNING, showMask, UIMessageDialogButtons.Ok, delay); + } + + public static void ShowError2(string message, bool showMask = false, int delay = 0) + { + ShowMessageDialog2(UILocalize.ErrorTitle, message, UINotifierType.ERROR, showMask, UIMessageDialogButtons.Ok, delay); + } + + public static bool ShowAsk2(string message, bool showMask = false, UIMessageDialogButtons defaultButton = UIMessageDialogButtons.Ok) + { + return ShowMessageDialog2(UILocalize.AskTitle, message, UINotifierType.Ask, showMask, defaultButton); + } + + public static bool ShowMessageDialog2(string title, string message, UINotifierType noteType, bool showMask = false, + UIMessageDialogButtons defaultButton = UIMessageDialogButtons.Cancel, int delay = 0) + { + return ShowMessageDialog2(null, title, message, noteType, showMask, defaultButton, delay); } ///