Exemplo n.º 1
0
        //开始运行程序
        protected override void OnStartup(StartupEventArgs e)
        {
            if (!AppContext.Current.LoadLocalConfig())
            {
                MessageBox.Show("加载本地配置文件失败!", "提示");
            }
            if (AppContext.Current.LocalConfig.ClientType == LocalConfig.ClientTypeEnum.Live)
            {
                //获取路径
                this.StartupUri = new Uri("Live.xaml", UriKind.Relative);
            }

            base.OnStartup(e);
            LogUtil.Setup();

            MapperBootstrapper.Run();

            //全局捕获异常
            //this.DispatcherUnhandledException += new DispatcherUnhandledExceptionEventHandler(this.Current_DispatcherUnhandledException);
            //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(this.CurrentDomain_UnhandledException);
        }