// Rename Playlist private void RenamePlaylist_MenuItemClick(object sender, RoutedEventArgs e) { string playlist_name = (string)listBox1.SelectedValue; if (playlist_name != "All Music") { Rename rename = new Rename(playlist_name); rename.ShowDialog(); if (rename.DialogResult == true) { if (musicLib.RenamePlaylist(playlist_name, rename.NewName)) { musicLib.Save(); UpdateList(); } } } else { MessageBox.Show("You can't rename All Music"); } }
// Prompt User for Playlist Name and Add Playlist to Library private void NewPlaylistButton_Click(object sender, RoutedEventArgs e) { Rename rename = new Rename(""); rename.ShowDialog(); if (rename.DialogResult == true) { if (!musicLib.PlaylistExists(rename.NewName)) { if (musicLib.AddPlaylist(rename.NewName)) { musicLib.Save(); UpdateList(); } } } }