protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); try { string fileName; AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); ApplicationService.Closing += new System.ComponentModel.CancelEventHandler(ApplicationService_Closing); ThemeHelper.LoadThemeFromRegister(); #if DEBUG bool trace = false; BindingErrorListener.Listen(m => { if (trace) MessageBox.Show(m); }); #endif _bootstrapper = new Bootstrapper(); using (new DoubleLaunchLocker(SignalId, WaitId)) _bootstrapper.Initialize(); if (Application.Current != null && e.Args != null && e.Args.Length > 0) { fileName = e.Args[0]; FileConfigurationHelper.LoadFromFile(fileName); } } finally { ServiceFactory.StartupService.Close(); } }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); #if DEBUG BindingErrorListener.Listen(m => MessageBox.Show(m)); #endif AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); ApplicationService.Closing += new System.ComponentModel.CancelEventHandler(ApplicationService_Closing); _bootstrapper = new Bootstrapper(); using (new DoubleLaunchLocker(SignalId, WaitId)) _bootstrapper.Initialize(); }