/// <summary> /// Gets the story details. /// </summary> /// <param name="stories">The stories.</param> /// <returns>List<Publication>.</returns> private List <Publication> GetStoryDetails(List <Publication> stories) { if (skipDetails) { return(stories); } Parallel.ForEach(stories.OrderBy(o => int.Parse(o.publishedOn)), story => { try { using (WebClient cli = new WebClient()) story.UrlData = cli.DownloadString(story.Url); OnNewsDetail(this, NewsDetailEventArgs.Create(story, watch)); } catch (Exception) { //TODO: need to log errors return; } }); OnNewsDetailComplete(this, NewsCompleteEventArgs.Create(stories, watch)); return(stories); }
/// <summary> /// Handles the <see cref="E:NewsEvent" /> event. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="NewsSummaryEventArgs" /> instance containing the event data.</param> protected virtual void OnNewsDetail(object sender, NewsDetailEventArgs e) { NewsDetail?.Invoke(sender, e); }