From 1fca2167068e9ef2c079ec742f20313fc6697ab1 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期一, 03 三月 2025 09:18:33 +0800
Subject: [PATCH] 完善代码;
---
WPFProject/App.xaml.cs | 18 +++++++-----------
1 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/WPFProject/App.xaml.cs b/WPFProject/App.xaml.cs
index 2715cec..882f867 100644
--- a/WPFProject/App.xaml.cs
+++ b/WPFProject/App.xaml.cs
@@ -1,14 +1,8 @@
-锘縰sing 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;
+锘縰sing HMI.UI.Util;
using log4net;
using Panuon.WPF.UI;
+using System;
+using System.Windows;
namespace WPFProject
{
@@ -26,10 +20,12 @@
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);
});
}
--
Gitblit v1.9.1