Beispiel #1
0
 private void DropList_Drop(object sender, DragEventArgs e)
 {
     ThreadPool.QueueUserWorkItem(a => {
         var stringData = e.Data.GetData(typeof(string)) as string;
         var songs      = stringData?.Split('\n');
         if (songs == null)
         {
             return;
         }
         try {
             foreach (var result in
                      songs.Select(songin => songin?.Split('/'))
                      .Select(splitted => splitted?[splitted.Length - 1]))
             {
                 ThreadPool.QueueUserWorkItem(async aa => {
                     var song = await _spotify.DownloadSongInformationAsync(result);
                     Songs.Add(song);
                     _downloader.Add(song);
                 });
             }
         } catch (Exception ex) {
             Debug.WriteLine(ex);
         }
     });
 }