void workerFiles_DoWork(object sender, DoWorkEventArgs e) { try { MultipleFilesRefreshOptions opt = e.Argument as MultipleFilesRefreshOptions; List <VM_AnimeEpisode_User> eps = VM_ShokoServer.Instance.ShokoServices.GetAllEpisodesWithMultipleFiles( VM_ShokoServer.Instance.CurrentUser.JMMUserID, opt.OnlyFinishedSeries, opt.IgnoreVariations).CastList <VM_AnimeEpisode_User>(); e.Result = eps; } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
public void RefreshMultipleFiles() { if (workerFiles.IsBusy) { return; } IsLoading = true; btnRefresh.IsEnabled = false; CurrentEpisodes.Clear(); EpisodeCount = 0; StatusMessage = Shoko.Commons.Properties.Resources.Loading; MultipleFilesRefreshOptions opt = new MultipleFilesRefreshOptions() { OnlyFinishedSeries = chkOnlyFinished.IsChecked.Value, IgnoreVariations = chkIgnoreVariations.IsChecked.Value }; workerFiles.RunWorkerAsync(opt); }