示例#1
0
 public void Run()
 {
     while (true)
     {
         Thread.Sleep(1000);
         DateTime now = DateTime.Now;
         if (now.Second != second)
         {
             TimeInfoEventArg timeInfoEventArg =
                 new TimeInfoEventArg(
                     now.Hour, now.Minute, now.Second
                     );
             if (SecondChanged != null)
             {
                 SecondChanged(this, timeInfoEventArg);
             }
         }
     }
 }
示例#2
0
 public void LogTime(object o, TimeInfoEventArg e)
 {
     Console.WriteLine($"Logging... {e.Hour.ToString()}:{e.Minute.ToString()}:{e.Second.ToString()}");
 }
示例#3
0
 public void NewTime(object o, TimeInfoEventArg e)
 {
     Console.WriteLine($"Current Time: {e.Hour.ToString()}:{e.Minute.ToString()}:{e.Second.ToString()}");
 }