static void Main() { if (mutex.WaitOne(TimeSpan.Zero, true)) { General.configPath = Application.StartupPath + @"\config.xml"; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); // if (!File.Exists(General.configPath)) { frmSettings x = new frmSettings(true); x.ShowDialog(); Application.Run(new Form1()); } else { General.cfg = XmlHelper.FromXmlFile <ConfigApp>(General.configPath); Application.Run(new Form1()); } } else { SingleExecution.SwitchToCurrentInstance(); } }
private void toolStripSettings_Click(object sender, EventArgs e) { frmSettings x = new frmSettings(false); x.ShowDialog(); //reflect the modifications toolStripRestart.DropDownItems["webrtc"].Tag = (General.cfg.g.enableWebRTC ? false : true); toolStripRestart.DropDownItems["webrtc"].Text = (General.cfg.g.enableWebRTC ? "disabled WebRTC" : "enabled WebRTC"); toolStripRestart.DropDownItems["agent"].Tag = (General.cfg.g.agent.Equals(agent_alternative) ? "c" : "s"); toolStripRestart.DropDownItems["agent"].Text = (General.cfg.g.agent.Equals(agent_alternative) ? "agent chrome" : "agent alternative"); }