コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: jgreenlee24/hTunes
 // 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");
     }
 }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: jgreenlee24/hTunes
 // 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();
             }
         }
     }
 }