public async Task DownloadAndImportFeeds(bool downloadInBackground = true, bool lockProtection = true) { var feedsData = await FeedTasks.DownloadFeeds(FeedsConfig); if (feedsData.Count == 0 || feedsData.All(fd => fd.NewItems.Count == 0)) { LogTo.Debug("No new entries downloaded."); return; } Application.Current.Dispatcher.Invoke( () => { LogTo.Debug("Creating NewContentWindow"); new NewContentWindow(feedsData, lockProtection).ShowAndActivate(); } ); }
private Task ImportFeeds() { return(FeedTasks.ImportFeeds(FeedsData) .ContinueWith(t => Dispatcher.Invoke(Close))); }