Exemplo n.º 1
0
        private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            string path = e.Argument as string;

            string[] files = Directory.GetFiles(path);
            foreach (string o in files)
            {
                FileInfo info   = new FileInfo(o);
                string   title  = "";
                string   artist = "";
                if (extension.Contains(info.Extension))
                {
                    ID3v2Tag tag = new ID3v2Tag(o);
                    artist = tag.artist;
                    title  = tag.title;
                    MusicFile musicFile = new MusicFile(o, title, artist);
                    this.Dispatcher.Invoke(addFileToListView, info.Name, musicFile);
                }
            }
        }
Exemplo n.º 2
0
 private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     string path = e.Argument as string;
     string[] files = Directory.GetFiles(path);
     foreach (string o in files)
     {
         FileInfo info = new FileInfo(o);
         string title = "";
         string artist = "";
         if (extension.Contains(info.Extension))
         {
             ID3v2Tag tag = new ID3v2Tag(o);
             artist = tag.artist;
             title = tag.title;
             MusicFile musicFile = new MusicFile(o, title, artist);
             this.Dispatcher.Invoke(addFileToListView, info.Name, musicFile);
         }
     }
 }