Пример #1
0
        public void RefreshBookmarkedAnime()
        {
            try
            {
                // set this to null so that it will be refreshed the next time it is needed

                List <VM_BookmarkedAnime> baRaw = VM_ShokoServer.Instance.ShokoServices.GetAllBookmarkedAnime().CastList <VM_BookmarkedAnime>();

                //if (baRaw.Count == 0) return;

                Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (Action) delegate
                {
                    BookmarkedAnime.Clear();

                    // must series before groups the binding is based on the groups, and will refresh when that is changed
                    foreach (VM_BookmarkedAnime ba in baRaw)
                    {
                        if (ba.DownloadingBool && BookmarkFilter_Downloading)
                        {
                            BookmarkedAnime.Add(ba);
                        }

                        if (!ba.DownloadingBool && BookmarkFilter_NotDownloading)
                        {
                            BookmarkedAnime.Add(ba);
                        }
                    }
                    ViewBookmarkedAnime.Refresh();
                });
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
        }
Пример #2
0
        public void RefreshBookmarkedAnime()
        {
            try
            {
                // set this to null so that it will be refreshed the next time it is needed

                List <JMMServerBinary.Contract_BookmarkedAnime> baRaw = JMMServerVM.Instance.clientBinaryHTTP.GetAllBookmarkedAnime();

                //if (baRaw.Count == 0) return;

                System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate()
                {
                    BookmarkedAnime.Clear();

                    // must series before groups the binding is based on the groups, and will refresh when that is changed
                    foreach (JMMServerBinary.Contract_BookmarkedAnime contract in baRaw)
                    {
                        BookmarkedAnimeVM ba = new BookmarkedAnimeVM(contract);

                        if (ba.DownloadingBool && BookmarkFilter_Downloading)
                        {
                            BookmarkedAnime.Add(ba);
                        }

                        if (ba.NotDownloadingBool && BookmarkFilter_NotDownloading)
                        {
                            BookmarkedAnime.Add(ba);
                        }
                    }
                    ViewBookmarkedAnime.Refresh();
                });
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
        }