private void Save() { ScoreCalcRuleRecordEditor editor = new ScoreCalcRuleRecordEditor(); editor.Name = txtNewName.Text; editor.Content = GetDefault(); editor.Save(); }
private void btnSave_Click(object sender, EventArgs e) { if (SelectedItem == null) { return; } if (!_error.HasError) { ScoreCalcRuleRecord record = SelectedItem.Tag as ScoreCalcRuleRecord; ScoreCalcRuleRecordEditor editor = record.GetEditor(); editor.Content = GetContent(); editor.Save(); } }
private void btnDelete_Click(object sender, EventArgs e) { if (SelectedItem == null) { return; } if (MsgBox.Show("您確定要刪除「" + SelectedItem.Text + "」嗎?", MessageBoxButtons.YesNo) == DialogResult.Yes) { ScoreCalcRuleRecord record = SelectedItem.Tag as ScoreCalcRuleRecord; ScoreCalcRuleRecordEditor editor = record.GetEditor(); editor.Remove = true; editor.Save(); } }