Example #1
0
 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();
 }
Example #2
0
 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;
 }