コード例 #1
0
 private void fillList(ListBox listPlaylist)
 {
     if (!Directory.Exists(PathPlaylist))
         Directory.CreateDirectory(PathPlaylist);
     try
     {
         string[] listFiles = Directory.GetFiles(PathPlaylist, "*.pls");
         foreach (string fileName in listFiles)
         {
             try
             {
                 Playlist onePlaylist = new Playlist(fileName);
                 onePlaylist.ParsePlaylist();
                 listPlaylist.Items.Add(onePlaylist);
             }
             catch (Exception ex)
             {
                 Console.WriteLine(ex.ToString());
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }
コード例 #2
0
 private void SelectPlaylist(object sender, RoutedEventArgs e)
 {
     ViewModelPlaylist context = this.DataContext as ViewModelPlaylist;
     playlist = this.ListPlaylist.SelectedValue as Playlist;
     bHasReturned = true;
     this.Close();
 }