Example #1
0
 public void ClearData()
 {
     AllGroupsDictionary.Clear();
     AllSeriesDictionary.Clear();
     AllAnimeDictionary.Clear();
     AllGroupFiltersDictionary.Clear();
     ViewSeriesSearch.Refresh();
     LastChange = DateTime.MinValue;
     OnRefreshed();
 }
Example #2
0
        public void ClearData()
        {
            AllGroups.Clear();
            AllSeries.Clear();
            AllGroupsDictionary.Clear();
            AllSeriesDictionary.Clear();
            AllAnimeDictionary.Clear();

            ViewSeriesSearch.Refresh();
        }
Example #3
0
        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);
            }
        }
Example #4
0
        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);
            }
        }