diff --git a/SunnyUI/Forms/UIFormHelper.cs b/SunnyUI/Forms/UIFormHelper.cs index 6e0b65f5..68cefd02 100644 --- a/SunnyUI/Forms/UIFormHelper.cs +++ b/SunnyUI/Forms/UIFormHelper.cs @@ -517,7 +517,7 @@ namespace Sunny.UI UINotifier.Show(desc, type, title, isDialog, timeout, inApp); } - public static void ShowNotifier(string desc, EventHandler clickEvent, UINotifierType type = UINotifierType.INFO, string title = "Notifier", int timeout = 0) + public static void ShowNotifier(string desc, EventHandler clickEvent, UINotifierType type = UINotifierType.INFO, string title = "Notifier", int timeout = 0) { UINotifier.Show(desc, type, title, false, timeout, null, clickEvent); } @@ -962,22 +962,22 @@ namespace Sunny.UI UINotifierHelper.ShowNotifier(desc, UINotifierType.ERROR, UIStyles.CurrentResources.ErrorTitle, isDialog, timeout); } - public static void ShowInfoNotifier(this Form form, string desc, EventHandler clickEvent, int timeout = 2000) + public static void ShowInfoNotifier(this Form form, string desc, EventHandler clickEvent, int timeout = 2000) { UINotifierHelper.ShowNotifier(desc, clickEvent, UINotifierType.INFO, UIStyles.CurrentResources.InfoTitle, timeout); } - public static void ShowSuccessNotifier(this Form form, string desc, EventHandler clickEvent, int timeout = 2000) + public static void ShowSuccessNotifier(this Form form, string desc, EventHandler clickEvent, int timeout = 2000) { UINotifierHelper.ShowNotifier(desc, clickEvent, UINotifierType.OK, UIStyles.CurrentResources.SuccessTitle, timeout); } - public static void ShowWarningNotifier(this Form form, string desc, EventHandler clickEvent, int timeout = 2000) + public static void ShowWarningNotifier(this Form form, string desc, EventHandler clickEvent, int timeout = 2000) { UINotifierHelper.ShowNotifier(desc, clickEvent, UINotifierType.WARNING, UIStyles.CurrentResources.WarningTitle, timeout); } - public static void ShowErrorNotifier(this Form form, string desc, EventHandler clickEvent, int timeout = 2000) + public static void ShowErrorNotifier(this Form form, string desc, EventHandler clickEvent, int timeout = 2000) { UINotifierHelper.ShowNotifier(desc, clickEvent, UINotifierType.ERROR, UIStyles.CurrentResources.ErrorTitle, timeout); } diff --git a/SunnyUI/Forms/UINotifier.cs b/SunnyUI/Forms/UINotifier.cs index bbc94c9b..5e25443b 100644 --- a/SunnyUI/Forms/UINotifier.cs +++ b/SunnyUI/Forms/UINotifier.cs @@ -442,7 +442,7 @@ namespace Sunny.UI // Show the note: it is the startup of the creation process of the note //------------------------------------------------------------------------------------------------------------------------------- public static short Show(string desc, UINotifierType type = UINotifierType.INFO, string title = "Notifier", - bool isDialog = false, int timeout = 0, Form inApp = null, EventHandler clickevent = null) + bool isDialog = false, int timeout = 0, Form inApp = null, EventHandler clickevent = null) { if (NotifierAlreadyPresent(desc, type, title, isDialog, out var updated_note_id, out var updated_note_occurence)) { @@ -713,14 +713,19 @@ namespace Sunny.UI { if (ItemClick != null) { - ItemClick.Invoke(this, e); + ItemClick.Invoke(this, new DescriptionEventArgs(Description)); closeMe(); } } - public event EventHandler ItemClick; + public event EventHandler ItemClick; } // Close Class + public class DescriptionEventArgs(string message) : EventArgs + { + public string Description { get; set; } = message; + } + /// /// 窗体背景风格 ///