private void btnAddSong_Click(object sender, EventArgs e) { string name = isTextValid(tbName.Text); string artist = isTextValid(tbArtist.Text); string tuning = (string)cbTuning.SelectedValue; Difficulty difficulty = (Difficulty)Enum.Parse(typeof(Difficulty), cbDifficulty.Text); switch (addOrEdit) { case AddOrEdit.Add: { SongList.AddNewSong(name, artist, tuning, difficulty); break; } case AddOrEdit.Edit: { songToEdit.Name = name; songToEdit.Artist = artist; songToEdit.Difficulty = difficulty; songToEdit.Tuning = tuning; break; } } mainUIForm.UpdateUIDisplay(); this.Close(); }
private void btnLogPractice_Click(object sender, EventArgs e) { songPracticed.DateTimeLastPracticed = DateTime.Now; songPracticed.Comments.Add(rtbPracticeComment.Text + " - " + DateTime.Now.ToString()); mainUI.UpdateUIDisplay(); this.Close(); }