private void FormMain_FormClosed(object sender, FormClosedEventArgs e) { bool success = true; HashIni ini = Profile.ReadAll(IniPath); success &= Profile.WriteBool(SECTION_OPTION, KEY_CHECK_SINGLECLICK, chkShowSingleClick.Checked, ini); success &= Profile.WriteBool(SECTION_OPTION, KEY_CHECK_DOUBLECLICK, chkShowDoubleClick.Checked, ini); success &= Profile.WriteBool(SECTION_OPTION, KEY_CHECK_UP, chkShowUp.Checked, ini); success &= Profile.WriteBool(SECTION_OPTION, KEY_CHECK_DOWN, chkShowDown.Checked, ini); success &= Profile.WriteBool(SECTION_OPTION, KEY_CHECK_WHEEL, chkShowWheel.Checked, ini); success &= Profile.WriteBool(SECTION_OPTION, KEY_CHECK_MOVE, chkShowMove.Checked, ini); success &= AmbLib.SaveFormXYWH(this, SECTION_LOCATION, ini); success &= Profile.WriteInt(SECTION_OPTION, KEY_SPLITTER_DISTANCE, splitMain.SplitterDistance, ini); if (success) { try { success &= Profile.WriteAll(ini, IniPath, true); } catch (Exception) { success = false; } } if (!success) { CppUtils.Alert(Properties.Resources.SAVE_FAILED); } }
private void FormMain_FormClosed(object sender, FormClosedEventArgs e) { string iniPath = IniPath; HashIni ini = Profile.ReadAll(iniPath); AmbLib.SaveFormXYWH(this, SECTION_LOCATION, ini); if (!Profile.WriteAll(ini, iniPath)) { MessageBox.Show("ini save failed"); } }
private void FormMain_FormClosed(object sender, FormClosedEventArgs e) { HashIni ini = Profile.ReadAll(IniPath); AmbLib.SaveFormXYWH(this, SECTION_LOCATION, ini); AmbLib.SaveListViewColumnWidth(listMain, SECTION_OPTION, KEY_COLUMN_WIDTH, ini); AmbLib.SaveComboBox(cmbApplication, SECTION_APP_COMBO, MAX_COMBO_SAVE, ini); AmbLib.SaveComboBox(cmbArguments, SECTION_ARG_COMBO, MAX_COMBO_SAVE, ini); if (!Profile.WriteAll(ini, IniPath)) { CppUtils.Alert("Failed to save ini"); } }
private void FormMain_FormClosed(object sender, FormClosedEventArgs e) { bool failed = false; HashIni ini = Profile.ReadAll(IniPath); failed |= !Ambiesoft.Profile.WriteString("option", "ffmpeg", ffmpeg_, ini); failed |= !AmbLib.SaveListViewColumnWidth(lvMain, SECTION_OPTION, KEY_COLUMN_WIDTH, ini); failed |= !AmbLib.SaveFormXYWH(this, SECTION_OPTION, ini); failed |= !Profile.WriteAll(ini, IniPath); if (failed) { CppUtils.CenteredMessageBox(this, Properties.Resources.S_INISAVE_FAILED, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); } }