コード例 #1
0
ファイル: App.xaml.cs プロジェクト: halaszk/Patchy
 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();
 }
コード例 #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;
 }