App.xaml.cs 1.07 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace FLY.Thick.BlowingScan.UI.Scan.Server
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
        FLY.AppHelper.AppJustOne appjustone;
潘栩锋's avatar
潘栩锋 committed
16
        NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
潘栩锋's avatar
潘栩锋 committed
17 18 19 20 21 22 23 24 25
        public App()
        {
            appjustone = new AppHelper.AppJustOne(this);


            //DispatcherUnhandledException += App_DispatcherUnhandledException;

            AppDomain.CurrentDomain.UnhandledException += (s, e) =>
            {
26
                log.Error((Exception)e.ExceptionObject, "AppDomain.CurrentDomain.UnhandledException");
潘栩锋's avatar
潘栩锋 committed
27 28 29 30 31 32 33 34 35
                string err = e.ExceptionObject.ToString();
                MessageBox.Show("程序出现异常,请把下面信息拍照发给厂家" + Environment.NewLine + err,
                    "异常,联系厂家",
                    MessageBoxButton.OK, MessageBoxImage.Error);

            };
        }
    }
}