Exemplo n.º 1
0
 public void Run()
 {
     for (; ;)
     {
         Thread.Sleep(200);
         DateTime dt = DateTime.Now;
         if (dt.Second != second)
         {
             TimeEventArgs ta = new TimeEventArgs(dt.Hour, dt.Minute, dt.Second);
             if (listOfHandlers != null)
             {
                 listOfHandlers(this, ta);
             }
         }
         this.hour   = dt.Hour;
         this.minute = dt.Minute;
         this.second = dt.Second;
     }
 }
Exemplo n.º 2
0
 //wvwnt handler to implement the publisher's delegate
 public void LogInfo(object clock, TimeEventArgs args)
 {
     Console.WriteLine("Logging the time infos ==> Time {0}::{1}::{2}", args.hour, args.minute, args.second);
 }
Exemplo n.º 3
0
 //event handler to implement publishers delegate
 public void ShowDisplayTime(object clock, TimeEventArgs args)
 {
     Console.WriteLine("The time is {0}::{1}::{2}", args.hour, args.minute, args.second);
 }