Exemplo n.º 1
0
        public void BuildTrackList()
        {
            var    files        = new DirectoryInfo(_libraryPath.AbsolutePath).EnumerateFiles("*.mp3", SearchOption.AllDirectories).ToList();
            double totalCount   = files.Count;
            double currentCount = 0;

            foreach (var file in files)
            {
                Library.Tracks.Add(_trackFactory.Create(file));

                currentCount++;
                double percentage = currentCount / totalCount * 100;
                _backgroundWorker.ReportProgress((int)percentage);
            }
        }