Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
        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;
            }
        }