123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Data;
- using System.Linq;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Threading;
- using Vinno.IUS.Common.Log;
- namespace vCloud.GeneratePackages.Tool
- {
- /// <summary>
- /// Interaction logic for App.xaml
- /// </summary>
- public partial class App : Application
- {
- protected override void OnStartup(StartupEventArgs e)
- {
- AppManager.MainDispatcher = Current.Dispatcher;
- AppDomain.CurrentDomain.UnhandledException += OnDomainUnhandledException;
- Current.DispatcherUnhandledException += OnCurrentDispatcherUnhandledException;
- base.OnStartup(e);
- }
- private void OnDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
- {
- Logger.WriteLineError($"OnDomainUnhandledException: {e.ExceptionObject}");
- Dispatcher.Invoke(() =>
- {
- MessageBox.Show($"OnDomainUnhandledException{e.ExceptionObject}");
- });
- }
- private void OnCurrentDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
- {
- Logger.WriteLineError($"OnCurrentDispatcherUnhandledException: {e.Exception}");
- Dispatcher.Invoke(() =>
- {
- MessageBox.Show($"OnCurrentDispatcherUnhandledException: {e.Exception}");
- });
- }
- }
- }
|