protected override void OnStartup(StartupEventArgs e) { bool isInitialInstance; Singleton = new Mutex(true, "Patchy:" + SingletonGuid, out isInitialInstance); if (!isInitialInstance) { PassArgumentsToInstance(e.Args); Current.Shutdown(); return; } MainWindow = new MainWindow(); CreateServiceHost(); (MainWindow as MainWindow).HandleArguments(e.Args); MainWindow.Show(); }
protected override void OnStartup(StartupEventArgs e) { bool isInitialInstance; Singleton = new Mutex(true, "Patchy:" + SingletonGuid, out isInitialInstance); if (!isInitialInstance) { PassArgumentsToInstance(e.Args); Current.Shutdown(); return; } MainWindow = new MainWindow(); CreateServiceHost(); (MainWindow as MainWindow).HandleArguments(e.Args); MainWindow.Show(); Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; }