ProcessQueue() public méthode

public ProcessQueue ( ) : void
Résultat void
Exemple #1
0
        private void UpdateBookmarkCacheStatus()
        {
            var bookmarks = App.DbDataContext.Bookmarks.ToList();
            var downloadsController = new DownloadsController();

            foreach (var bookmark in bookmarks)
            {
                if (!BookmarksStorageManager.DoesBookmarkBodyExist(bookmark.BookmarkId) && bookmark.IsDownloaded)
                {
                    bookmark.IsDownloaded = false;
                    bookmark.ShortBodyText = "Downloading...";
                    downloadsController.AddBookmark(bookmark);
                }
            }

            App.DbDataContext.SubmitChanges();
            downloadsController.ProcessQueue();
        }
Exemple #2
0
        public void LoadDataFromWeb()
        {
            this.IsLoading = true;
            var downloadsController = new DownloadsController();

            App.InstapaperAPI.GetUnreadBookmarks(null, true, bookmarks =>
            {
                var trimmedBookmarks = bookmarks.Take(25);
                UpdateBookmarksWithData(trimmedBookmarks);
                downloadsController.AddBookmarks(trimmedBookmarks);

                App.InstapaperAPI.GetStarredBookmarks(true, (starredBookmarks =>
                {
                    var trimmedStarredBookmarks = starredBookmarks.Take(10);
                    UpdateBookmarksWithData(trimmedStarredBookmarks);
                    downloadsController.AddBookmarks(trimmedStarredBookmarks);

                    App.InstapaperAPI.GetArchiveBookmarks(true, (archivedBookmarks =>
                    {
                        var trimmedArchivedBookmarks = archivedBookmarks.Take(5);
                        UpdateBookmarksWithData(trimmedArchivedBookmarks);
                        downloadsController.AddBookmarks(trimmedArchivedBookmarks);

                        downloadsController.ProcessQueue();
                    }));
                }));
            });

            this.IsLoading = false;
        }