public static void Main() { var si = new SingleInstanceApp(AppName); si.ReceiveString += Si_ReceiveString; if (si.IsFirstInstance) { var application = new App(); CdData = new Dictionary <string, string>(); DiscID = ""; RecentUrls = new HashSet <string>(); FillUrlList(); application.InitializeComponent(); application.ShutdownMode = ShutdownMode.OnMainWindowClose; application.Run(); si.Close(); } else { si.SubmitParameters(); } }
public static void Main() { var si = new SingleInstanceApp(AppName); si.ReceiveString += Si_ReceiveString; if (si.IsFirstInstance) { var hasher = new EngineHashChecker(); if (!hasher.CheckHashes()) { MessageBox.Show(TCPlayer.Properties.Resources.Error_CorruptDll, TCPlayer.Properties.Resources.Error_Title, MessageBoxButton.OK, MessageBoxImage.Error); return; } SetAppCulture(); var application = new App(); CdData = new Dictionary <string, string>(); DiscID = ""; RecentUrls = new HashSet <string>(); FillUrlList(); application.InitializeComponent(); _prevactive = true; _active = true; application.ShutdownMode = ShutdownMode.OnMainWindowClose; application.MainWindow = new MainWindow(); application.MainWindow.Activated += MainWindow_Activated; application.MainWindow.Deactivated += MainWindow_Deactivated; application.Run(application.MainWindow); si.Close(); } else { si.SubmitParameters(); } }