static Program() { try { RenderOptions.ProcessRenderMode = Prefs.UseHardwareRendering ? RenderMode.Default : RenderMode.SoftwareOnly; } catch (Exception) { // if the system gets mad, best to leave it alone. } UseTransparentWindows = Prefs.UseWindowTransparency; WebsitePath = ConfigurationManager.AppSettings["WebsitePath"]; ChatServerPath = ConfigurationManager.AppSettings["ChatServerPath"]; GameServerPath = ConfigurationManager.AppSettings["GameServerPath"]; GameFeed = ConfigurationManager.AppSettings["GameFeed"]; UseGamePackageManagement = bool.Parse(ConfigurationManager.AppSettings["UseGamePackageManagement"]); #if (Release_Test) UpdateInfoPath = ConfigurationManager.AppSettings["UpdateCheckPathTest"]; #else UpdateInfoPath = ConfigurationManager.AppSettings["UpdateCheckPath"]; #endif var pList = Process.GetProcessesByName("OCTGN"); if (pList != null && pList.Length > 0 && pList.Any(x => x.Id != Process.GetCurrentProcess().Id)) { var res = MessageBox.Show("Another instance of OCTGN is current running. Would you like to close it?", "OCTGN", MessageBoxButton.YesNo, MessageBoxImage.Question); if (res == MessageBoxResult.Yes) { foreach (var p in Process.GetProcessesByName("OCTGN")) { if (p.Id != Process.GetCurrentProcess().Id) { p.Kill(); } } } } LobbyClient = new Skylabs.Lobby.Client(ChatServerPath); Debug.Listeners.Add(DebugListener); DebugTrace.Listeners.Add(DebugListener); Trace.Listeners.Add(DebugListener); //BasePath = Path.GetDirectoryName(typeof (Program).Assembly.Location) + '\\'; GamesPath = BasePath + @"Games\"; MainWindowNew = new Main(); Application.Current.MainWindow = MainWindowNew; }
static Program() { try { RenderOptions.ProcessRenderMode = Prefs.UseHardwareRendering ? RenderMode.Default : RenderMode.SoftwareOnly; } catch (Exception) { // if the system gets mad, best to leave it alone. } UseTransparentWindows = Prefs.UseWindowTransparency; WebsitePath = ConfigurationManager.AppSettings["WebsitePath"]; ChatServerPath = ConfigurationManager.AppSettings["ChatServerPath"]; GameServerPath = ConfigurationManager.AppSettings["GameServerPath"]; GameFeed = ConfigurationManager.AppSettings["GameFeed"]; UseGamePackageManagement = bool.Parse(ConfigurationManager.AppSettings["UseGamePackageManagement"]); #if(Release_Test) UpdateInfoPath = ConfigurationManager.AppSettings["UpdateCheckPathTest"]; #else UpdateInfoPath = ConfigurationManager.AppSettings["UpdateCheckPath"]; #endif var pList = Process.GetProcessesByName("OCTGN"); if(pList != null && pList.Length > 0 && pList.Any(x=>x.Id != Process.GetCurrentProcess().Id)) { var res = MessageBox.Show("Another instance of OCTGN is current running. Would you like to close it?","OCTGN",MessageBoxButton.YesNo,MessageBoxImage.Question); if (res == MessageBoxResult.Yes) { foreach (var p in Process.GetProcessesByName("OCTGN")) { if (p.Id != Process.GetCurrentProcess().Id) p.Kill(); } } } LobbyClient = new Skylabs.Lobby.Client(ChatServerPath); Debug.Listeners.Add(DebugListener); DebugTrace.Listeners.Add(DebugListener); Trace.Listeners.Add(DebugListener); //BasePath = Path.GetDirectoryName(typeof (Program).Assembly.Location) + '\\'; GamesPath = BasePath + @"Games\"; MainWindowNew = new Main(); Application.Current.MainWindow = MainWindowNew; }