public void ClearData() { AllGroupsDictionary.Clear(); AllSeriesDictionary.Clear(); AllAnimeDictionary.Clear(); AllGroupFiltersDictionary.Clear(); ViewSeriesSearch.Refresh(); LastChange = DateTime.MinValue; OnRefreshed(); }
public void ClearData() { AllGroups.Clear(); AllSeries.Clear(); AllGroupsDictionary.Clear(); AllSeriesDictionary.Clear(); AllAnimeDictionary.Clear(); ViewSeriesSearch.Refresh(); }
public void RefreshGroupsSeriesData() { //LoadTestData(); //return; try { // set this to null so that it will be refreshed the next time it is needed AllAnimeDetailedDictionary = null; List <JMMServerBinary.Contract_AnimeGroup> grpsRaw = JMMServerVM.Instance.clientBinaryHTTP.GetAllGroups(JMMServerVM.Instance.CurrentUser.JMMUserID.Value); List <JMMServerBinary.Contract_AnimeSeries> seriesRaw = JMMServerVM.Instance.clientBinaryHTTP.GetAllSeries(JMMServerVM.Instance.CurrentUser.JMMUserID.Value); if (grpsRaw.Count == 0 || seriesRaw.Count == 0) { return; } System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate() { AllGroups.Clear(); AllSeries.Clear(); AllGroupsDictionary.Clear(); AllSeriesDictionary.Clear(); AllAnimeDictionary.Clear(); // must series before groups the binding is based on the groups, and will refresh when that is changed foreach (JMMServerBinary.Contract_AnimeSeries ser in seriesRaw) { AnimeSeriesVM serNew = new AnimeSeriesVM(ser); AllSeries.Add(serNew); AllSeriesDictionary[serNew.AnimeSeriesID.Value] = serNew; } ViewSeriesSearch.Refresh(); foreach (JMMServerBinary.Contract_AnimeGroup grp in grpsRaw) { AnimeGroupVM grpNew = new AnimeGroupVM(grp); AllGroups.Add(grpNew); AllGroupsDictionary[grpNew.AnimeGroupID.Value] = grpNew; } }); } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
public void InitGroupsSeriesData() { //LoadTestData(); //return; try { // set this to null so that it will be refreshed the next time it is needed AllAnimeDetailedDictionary = null; List <JMMServerBinary.Contract_AnimeGroup> grpsRaw = JMMServerVM.Instance.clientBinaryHTTP.GetAllGroups(JMMServerVM.Instance.CurrentUser.JMMUserID.Value); List <JMMServerBinary.Contract_AnimeSeries> seriesRaw = JMMServerVM.Instance.clientBinaryHTTP.GetAllSeries(JMMServerVM.Instance.CurrentUser.JMMUserID.Value); if (grpsRaw.Count == 0 || seriesRaw.Count == 0) { return; } AllGroups.Clear(); AllSeries.Clear(); AllGroupsDictionary.Clear(); AllSeriesDictionary.Clear(); AllAnimeDictionary.Clear(); // must series before groups the binding is based on the groups, and will refresh when that is changed foreach (JMMServerBinary.Contract_AnimeSeries ser in seriesRaw) { AnimeSeriesVM serNew = new AnimeSeriesVM(ser); AllSeries.Add(serNew); AllSeriesDictionary[serNew.AnimeSeriesID.Value] = serNew; } foreach (JMMServerBinary.Contract_AnimeGroup grp in grpsRaw) { AnimeGroupVM grpNew = new AnimeGroupVM(grp); AllGroups.Add(grpNew); AllGroupsDictionary[grpNew.AnimeGroupID.Value] = grpNew; } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }