示例#1
0
        public void Run()
        {
            for (;;)
            {
                Thread.Sleep(100);
                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()}");
 }