private void addButton_Click(object sender, EventArgs e) { try { ArtistForm.Run(new Artist(_artistList)); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error adding new artist"); } }
public static void Run(Artist artist) { ArtistForm artistForm; if (!_artistFormList.TryGetValue(artist, out artistForm)) { artistForm = new ArtistForm(); _artistFormList.Add(artist, artistForm); artistForm.SetDetails(artist); } else { artistForm.Show(); artistForm.Activate(); } }
private void artistList_DoubleClick(object sender, EventArgs e) { string key; key = Convert.ToString(artistList.SelectedItem); if (key != null) { try { ArtistForm.Run(_artistList[key]); } catch (Exception ex) { MessageBox.Show(ex.Message, "This should never occur"); } } }