using MahApps.Metro.Controls;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace WSDDBBrowser
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
        public static MetroWindow MetroWindow { get; set; }

        public App()
        {
            AppDomain.CurrentDomain.UnhandledException += (s, e) =>
            {
                string err = e.ExceptionObject.ToString();

                MessageBox.Show("程序出现异常，请把下面信息拍照发给厂家" + Environment.NewLine + err,
                    "异常，联系厂家",
                    MessageBoxButton.OK, MessageBoxImage.Error);

            };

            //加载全部 AutoMapper.Profile !!!!!!!!!!!
            //var assemblies = System.AppDomain.CurrentDomain.GetAssemblies();
            var cfg = new AutoMapper.Configuration.MapperConfigurationExpression();
            cfg.AddProfiles("WSDDBBrowser");
            AutoMapper.Mapper.Initialize(cfg);
        }
    }
}
