public void RefreshSeriesMissingEps() { try { System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate() { SeriesMissingEps.Clear(); }); List <JMMServerBinary.Contract_AnimeSeries> epSeries = JMMServerVM.Instance.clientBinaryHTTP.GetSeriesWithMissingEpisodes(UserSettingsVM.Instance.Dash_MissingEps_Items, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate() { foreach (JMMServerBinary.Contract_AnimeSeries contract in epSeries) { AnimeSeriesVM ser = new AnimeSeriesVM(contract); if (JMMServerVM.Instance.CurrentUser.EvaluateSeries(ser)) { SeriesMissingEps.Add(ser); } } ViewSeriesMissingEps.Refresh(); }); } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { } }
public void RefreshSeriesMissingEps() { try { System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate { SeriesMissingEps.Clear(); }); List <VM_AnimeSeries_User> epSeries = VM_ShokoServer.Instance.ShokoServices.GetSeriesWithMissingEpisodes(VM_UserSettings.Instance.Dash_MissingEps_Items, VM_ShokoServer.Instance.CurrentUser.JMMUserID).CastList <VM_AnimeSeries_User>(); System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate { foreach (VM_AnimeSeries_User ser in epSeries) { if (VM_ShokoServer.Instance.CurrentUser.EvaluateSeries(ser)) { SeriesMissingEps.Add(ser); } } ViewSeriesMissingEps.Refresh(); }); } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
public void RefreshData(bool refreshContinueWatching, bool refreshRecentAdditions, bool refreshOtherWidgets, RecentAdditionsType addType) { try { IsLoadingData = true; // clear all displayed data System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate() { if (refreshContinueWatching) { EpsWatchNext_Recent.Clear(); } if (refreshRecentAdditions) { RecentAdditions.Clear(); } if (refreshOtherWidgets) { SeriesMissingEps.Clear(); EpsWatchedRecently.Clear(); MiniCalendar.Clear(); RecommendationsWatch.Clear(); RecommendationsDownload.Clear(); } if (refreshOtherWidgets) { ViewEpsWatchedRecently.Refresh(); ViewSeriesMissingEps.Refresh(); ViewMiniCalendar.Refresh(); ViewRecommendationsWatch.Refresh(); ViewRecommendationsDownload.Refresh(); ViewRecentAdditions.Refresh(); } if (refreshContinueWatching) { ViewEpsWatchNext_Recent.Refresh(); } if (refreshRecentAdditions) { ViewRecentAdditions.Refresh(); } }); DateTime start = DateTime.Now; MainListHelperVM.Instance.RefreshGroupsSeriesData(); TimeSpan ts = DateTime.Now - start; logger.Trace("Dashboard Time: RefreshGroupsSeriesData: {0}", ts.TotalMilliseconds); if (refreshContinueWatching && UserSettingsVM.Instance.DashWatchNextEpExpanded) { RefreshEpsWatchNext_Recent(); } if (refreshRecentAdditions && UserSettingsVM.Instance.DashRecentAdditionsExpanded) { RefreshRecentAdditions(addType); } if (refreshOtherWidgets) { if (UserSettingsVM.Instance.DashRecentlyWatchEpsExpanded) { RefreshRecentlyWatchedEps(); } if (UserSettingsVM.Instance.DashSeriesMissingEpisodesExpanded) { RefreshSeriesMissingEps(); } if (UserSettingsVM.Instance.DashMiniCalendarExpanded) { RefreshMiniCalendar(); } if (UserSettingsVM.Instance.DashRecommendationsWatchExpanded) { RefreshRecommendationsWatch(); } if (UserSettingsVM.Instance.DashRecommendationsDownloadExpanded) { RefreshRecommendationsDownload(); } } IsLoadingData = false; } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { } }