private void RegisterWin_FormClosed(object sender, FormClosedEventArgs e) { // normalize { for (int index = 0; index < Gnd.ClientInfos.Count; index++) { if (Gnd.ClientInfos[index].Url[0] != 'h') { Gnd.ClientInfos.RemoveAt(index); index--; } } } Gnd.SaveToFile(); }
private void SaveData() { Gnd.ProxyMode = (Gnd.ProxyMode_e) this.ProxyMode.SelectedIndex; Gnd.ProxyHost = this.ProxyHost.Text; Gnd.ProxyPort = IntTools.ToInt(this.ProxyPort.Text, 1, 65535, 8080); // normalize { if (Gnd.ProxyHost == "") { Gnd.ProxyHost = "none"; } Gnd.ProxyHost = JString.ToAsciiToken(Gnd.ProxyHost, 1, 300); } Gnd.SaveToFile(); }
static void Main() { BootTools.OnBoot(); Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); SystemEvents.SessionEnding += new SessionEndingEventHandler(SessionEnding); Mutex procMutex = new Mutex(false, "{b68179af-7285-4a8c-a16e-f36b107e42cc}"); if (procMutex.WaitOne(0) && GlobalProcMtx.Create("{82820e8e-4256-4c75-87a2-9a9851f46c5b}", APP_TITLE)) { CheckSelfDir(); CheckCopiedExe(); Gnd.Init(); Gnd.LoadConf(); Gnd.LoadFromFile(); // orig > Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainWin()); // < orig // ここではフォームは開けない -> MainWin.cs CloseWindow() Gnd.SaveToFile(); GlobalProcMtx.Release(); procMutex.ReleaseMutex(); } procMutex.Close(); }