/// <summary> /// PocketLadio終了時の処理。 /// </summary> public static void ExitDisable() { // 設定ファイルの書き込み UserSetting.SaveSetting(); }
private void SettingForm_Closing(object sender, System.ComponentModel.CancelEventArgs e) { // 設定の書き込み if (playlistSaveLocalCheckBox.Checked == true) { UserSetting.PlayListSave = true; } else if (playlistSaveLocalCheckBox.Checked == false) { UserSetting.PlayListSave = false; } UserSetting.MediaPlayerPath = mediaPlayerPathTextBox.Text.Trim(); UserSetting.BrowserPath = browserPathTextBox.Text.Trim(); try { UserSetting.HeadlineTimerMillSecond = Convert.ToInt32(headlineTimerSecondNumericUpDown.Text) * 1000; } catch (ArgumentException) { ; } catch (FormatException) { ; } catch (OverflowException) { ; } if (headlineListBoxFontSizeCheckBox.Checked == true) { UserSetting.HeadlineListBoxFontSizeChange = true; } else if (headlineListBoxFontSizeCheckBox.Checked == false) { UserSetting.HeadlineListBoxFontSizeChange = false; } try { UserSetting.HeadlineListBoxFontSize = Convert.ToInt32(headlineListBoxFontSizeNumericUpDown.Text); } catch (ArgumentException) { ; } catch (FormatException) { ; } catch (OverflowException) { ; } if (proxyUnuseRadioButton.Checked == true) { UserSetting.ProxyUse = UserSetting.ProxyConnect.Unuse; } else if (proxyUseOsSettingRadioButton.Checked == true) { UserSetting.ProxyUse = UserSetting.ProxyConnect.OsSetting; } else if (proxyUseOriginalSettingRadioButton.Checked == true) { UserSetting.ProxyUse = UserSetting.ProxyConnect.OriginalSetting; } else { // ここに到達することはあり得ない Trace.Assert(false, "想定外の動作のため、終了します"); } UserSetting.ProxyServer = proxyServerTextBox.Text.Trim(); try { UserSetting.ProxyPort = int.Parse(proxyPortTextBox.Text.Trim()); } catch (ArgumentException) { ; } catch (FormatException) { ; } catch (OverflowException) { ; } try { UserSetting.SaveSetting(); } catch (IOException) { MessageBox.Show("設定ファイルが書き込めませんでした", "設定ファイル書き込みエラー"); } }