private void FormMain_FormClosing(object sender, FormClosingEventArgs e) { if (Utility.Configuration.Config.Life.ConfirmOnClosing) { if (MessageBox.Show(SoftwareInformation.SoftwareNameJapanese + " を終了しますか?", "確認", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.No) { e.Cancel = true; return; } } Utility.Logger.Add(2, SoftwareInformation.SoftwareNameJapanese + " を終了しています…"); UIUpdateTimer.Stop(); fBrowser.CloseBrowser(); if (!Directory.Exists("Settings")) { Directory.CreateDirectory("Settings"); } SystemEvents.OnSystemShuttingDown(); SaveLayout(Configuration.Config.Life.LayoutFilePath); }
private void FormMain_FormClosing(object sender, FormClosingEventArgs e) { if (Utility.Configuration.Config.Life.ConfirmOnClosing) { if (MessageBox.Show(SoftwareInformation.SoftwareNameJapanese + " を終了しますか?", "確認", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.No) { e.Cancel = true; return; } } Utility.Logger.Add(2, SoftwareInformation.SoftwareNameJapanese + " を終了しています…"); UIUpdateTimer.Stop(); fBrowser.CloseBrowser(); UpdatePlayTime(); SystemEvents.OnSystemShuttingDown(); SaveLayout(Configuration.Config.Life.LayoutFilePath); // 音量の保存 { try { uint id = (uint)System.Diagnostics.Process.GetCurrentProcess().Id; Utility.Configuration.Config.Control.LastVolume = BrowserLib.VolumeManager.GetApplicationVolume(id); Utility.Configuration.Config.Control.LastIsMute = BrowserLib.VolumeManager.GetApplicationMute(id); } catch (Exception) { /* ぷちっ */ } } }