private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { Log.Logger.Debug("設定項目削除"); if (IsChange) { if (MessageBox.Show("変更内容を破棄して削除しますか?", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK) { return; } } configListView.Items[SelectIndex].Remove(); configItems.RemoveAt(SelectIndex); IsChange = false; SelectIndex = Math.Min(SelectIndex, configListView.Items.Count - 1); if (configListView.Items.Count > 0) { configListView.Items[SelectIndex].Selected = true; } else { configGroupBox.Enabled = false; } ConfigItem.Save(configItems); }
private void saveButton_Click(object sender, EventArgs e) { Log.Logger.Debug("設定ファイル書き込み"); configItems[SelectIndex].SetConfig(nameTextBox.Text, explainTextBox.Text, timingTextBox.Text, filepathTextBox.Text, paramTextBox.Text, enabledCheckBox.Checked); configListView.Items[SelectIndex].SubItems[0].Text = nameTextBox.Text; configListView.Items[SelectIndex].SubItems[1].Text = timingTextBox.Text; configListView.Items[SelectIndex].SubItems[2].Text = filepathTextBox.Text; configListView.Items[SelectIndex].SubItems[3].Text = enabledCheckBox.Checked.ToString(); IsChange = false; ConfigItem.Save(configItems); }