コード例 #1
0
ファイル: MainListHelperVM.cs プロジェクト: RickDB/jmmclient
 void searchTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
 {
     System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate()
     {
         SearchResultCount = 0;
         ViewSeriesSearch.Refresh();
     });
 }
コード例 #2
0
 void searchTimer_Elapsed(object sender, ElapsedEventArgs e)
 {
     Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (Action) delegate
     {
         SearchResultCount = 0;
         ViewSeriesSearch.Refresh();
     });
 }
コード例 #3
0
ファイル: MainListHelperVM.cs プロジェクト: RickDB/jmmclient
 public void ClearData()
 {
     AllGroupsDictionary.Clear();
     AllSeriesDictionary.Clear();
     AllAnimeDictionary.Clear();
     AllGroupFiltersDictionary.Clear();
     ViewSeriesSearch.Refresh();
     LastChange = DateTime.MinValue;
     OnRefreshed();
 }
コード例 #4
0
ファイル: MainListHelperVM.cs プロジェクト: ewelike23/jmm
        public void ClearData()
        {
            AllGroups.Clear();
            AllSeries.Clear();
            AllGroupsDictionary.Clear();
            AllSeriesDictionary.Clear();
            AllAnimeDictionary.Clear();

            ViewSeriesSearch.Refresh();
        }
コード例 #5
0
ファイル: MainListHelperVM.cs プロジェクト: ewelike23/jmm
        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);
            }
        }