| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Configuration; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using System.Windows; |
| | | using HMI.UI.Util; |
| | | using System.Windows.Markup; |
| | | using HMI.UI.Util; |
| | | using log4net; |
| | | using Panuon.WPF.UI; |
| | | using System; |
| | | using System.Windows; |
| | | |
| | | namespace WPFProject |
| | | { |
| | |
| | | |
| | | private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) |
| | | { |
| | | log.Error("未知异常", e.ExceptionObject as Exception); |
| | | var ex = e.ExceptionObject as Exception; |
| | | log.Error("UnhandledException.", ex); |
| | | Dispatcher.Invoke(() => |
| | | { |
| | | MsgBoxHelper.ErrorMessage(Current.MainWindow, $"发生未知异常!程序即将关闭", "错误", MessageBoxButton.OK, |
| | | MsgBoxHelper.ErrorMessage(Current.MainWindow, $"发生未知异常!程序即将关闭\r\n{ex?.Message}", |
| | | "错误", MessageBoxButton.OK, |
| | | MessageBoxIcon.Error, DefaultButton.YesOK, 5); |
| | | }); |
| | | } |