private void LoadTrackImages(object sender, DoWorkEventArgs args) { var worker = sender as BackgroundWorker; var tracksToLoad = new List <IOldTrack>(); lock (boundTracks) { tracksToLoad.AddRange(boundTracks); } foreach (var track in tracksToLoad) { if (worker.CancellationPending) { args.Cancel = true; break; } var uri = new Uri(track.Path); if (uri.IsFile) { tagController.LoadPicture(track); } } }
private void LoadAutocompleteImages(object sender, DoWorkEventArgs args) { var worker = sender as BackgroundWorker; var tracksToLoad = new List <IOldTrack>(); lock (autocompleteTracks) { tracksToLoad.AddRange(autocompleteTracks); } foreach (var track in tracksToLoad) { if (worker.CancellationPending) { args.Cancel = true; break; } tagController.LoadPicture(track); } }