Пример #1
0
 // the method that implements the delegated functionality
 public void NewsPublished(object medium, NewsEventArgs news)
 {
     Console.WriteLine("{0} received news: \n" +
                       "Title: {1}: \n" +
                       "Content: {2} \n" +
                       "Published: {3}", this.Name, news.Title, news.Content, news.Time);
 }
Пример #2
0
        public void SendBreakingNews(string title, string content, DateTime time)
        {
            NewsEventArgs newsInfo = new NewsEventArgs(title, content, time);

            if (NewsChange != null)
            {
                NewsChange(this, newsInfo);
            }
        }