| | |
| | | public partial class App : Application |
| | | { |
| | | private ILog log; |
| | | private LogCleanner logCleanner; |
| | | public App() |
| | | { |
| | | log = LogManager.GetLogger("APP"); |
| | |
| | | { |
| | | var ex = e.ExceptionObject as Exception; |
| | | log.Error("UnhandledException.", ex); |
| | | MsgBoxHelper.ErrorMessage(Current.MainWindow, this.lang("App.AppUnhandledException",ex.Message), |
| | | MsgBoxHelper.ErrorMessage(Current.MainWindow, this.lang("App.AppUnhandledException", ex.Message), |
| | | this.lang("App.Error"), MessageBoxButton.OK, |
| | | MessageBoxIcon.Error, DefaultButton.YesOK, 5); |
| | | } |
| | |
| | | mutex = new Mutex(true, "TestPlatform_OnlyRun_CRNS"); |
| | | if (mutex.WaitOne(0, false)) |
| | | { |
| | | logCleanner = new LogCleanner(); |
| | | AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; |
| | | |
| | | LoggerHelper.Register(new CommonLogger()); |
| | | LangUtil.Load(); |
| | | SystemSetting.SystemSettingChanged += SystemSetting_SystemSettingChanged; |
| | | ToastHelper.Register(new MainToastHandler()); |