private void AddPerformanceBtn_Click(object sender, EventArgs e) { var form = new PerformanceInfoForm(); if (form.ShowDialog() == DialogResult.OK) { Repertoire.Performances.Add(form.Performance); performancesListBox.Items.Add(form.Performance); } }
private void EditSelectedBtn_Click(object sender, EventArgs e) { var selectedPerformance = repertoire.GetPerformanceByToString(performancesListBox.SelectedItem.ToString()); var editPerformanceForm = new PerformanceInfoForm(selectedPerformance); if (editPerformanceForm.ShowDialog() == DialogResult.OK) { repertoire.Performances.Remove(selectedPerformance); repertoire.Performances.Add(editPerformanceForm.Performance); performancesListBox.SelectedItem = editPerformanceForm.Performance; } }