| | |
| | | using HMI.Core.Util; |
| | | using Panuon.WPF.UI; |
| | | using System.Runtime.CompilerServices; |
| | | using System; |
| | | using System.Windows; |
| | | using System.Windows.Controls; |
| | | |
| | |
| | | ToastPosition position = ToastPosition.Top, double offset = 0, int durationMs = 3000, |
| | | ToastWindow targetWindow = ToastWindow.ActiveWindow) |
| | | { |
| | | Application.Current.Dispatcher.BeginInvoke(new Action(() => |
| | | { |
| | | var window = Application.Current.MainWindow; |
| | | if (window is WindowX) |
| | | { |
| | |
| | | { |
| | | MessageBox.Show(message, LangUtil.Get("App.Success")); |
| | | } |
| | | })); |
| | | } |
| | | |
| | | public static void Warning(string message, |
| | | MessageBoxIcon icon = MessageBoxIcon.Warning, |
| | | ToastPosition position = ToastPosition.Top, double offset = 0, int durationMs = 3000, |
| | | ToastWindow targetWindow = ToastWindow.ActiveWindow) |
| | | { |
| | | Application.Current.Dispatcher.BeginInvoke(new Action(() => |
| | | { |
| | | var window = Application.Current.MainWindow; |
| | | if (window is WindowX) |
| | |
| | | { |
| | | MessageBox.Show(message, LangUtil.Get("App.Warn")); |
| | | } |
| | | })); |
| | | } |
| | | |
| | | public static void Error(string message, |
| | | MessageBoxIcon icon = MessageBoxIcon.Error, |
| | | ToastPosition position = ToastPosition.Top, double offset = 0, int durationMs = 3000, |
| | | ToastWindow targetWindow = ToastWindow.ActiveWindow) |
| | | { |
| | | Application.Current.Dispatcher.BeginInvoke(new Action(() => |
| | | { |
| | | var window = Application.Current.MainWindow; |
| | | if (window is WindowX) |
| | |
| | | { |
| | | MessageBox.Show(message, LangUtil.Get("App.Error")); |
| | | } |
| | | })); |
| | | } |
| | | |
| | | public static void Info(string message, |
| | | MessageBoxIcon icon = MessageBoxIcon.Info, |
| | | ToastPosition position = ToastPosition.Top, double offset = 0, int durationMs = 3000, |
| | | ToastWindow targetWindow = ToastWindow.ActiveWindow) |
| | | { |
| | | Application.Current.Dispatcher.BeginInvoke(new Action(() => |
| | | { |
| | | var window = Application.Current.MainWindow; |
| | | if (window is WindowX) |
| | |
| | | { |
| | | MessageBox.Show(message, LangUtil.Get("App.Info")); |
| | | } |
| | | })); |
| | | } |
| | | |
| | | |