Exemplo n.º 1
0
 /// <summary>
 /// Handles the <see cref="E:Start" /> event.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 protected virtual void OnStart(object sender, NewsEventArgs e)
 {
     if (Start != null)
     {
         Start(sender, e);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Handles the <see cref="E:NewsEvent" /> event.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="NewsEventArgs"/> instance containing the event data.</param>
 protected virtual void OnNewsEvent(object sender, NewsEventArgs e)
 {
     if (NewsEvent != null)
     {
         NewsEvent(sender, e);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Saves the stories.
        /// </summary>
        /// <param name="providers">The providers.</param>
        /// <param name="news">The news.</param>
        private void SaveStories(List <Models.Provider> providers, List <Models.Publication> news)
        {
            if (config.SaveStories == true)
            {
                repoNews.SaveStories(providers, news);
            }

            NewsEventArgs args = new NewsEventArgs(news, providers);

            OnNewsEvent(this, args);
            Console.Beep();
        }