public void RingOrShow(string a, string b, string c) { SetClock args = new SetClock(); args.hour = a; args.minute = b; args.second = c; while (true) { string nHour = DateTime.Now.Hour.ToString(); string nMinute = DateTime.Now.Minute.ToString(); string nSecord = DateTime.Now.Second.ToString(); if (nHour.Equals(a) && nMinute.Equals(b)) { break; } } eClock(this); }
public void Ring(string a, string b, string c) //响铃 { var args = new SetClock { Hour = a, Minute = b, Second = c }; while (true) { var dateNowHour = DateTime.Now.Hour.ToString(); var dateNowMinute = DateTime.Now.Minute.ToString(); var dateNowSecond = DateTime.Now.Second.ToString(); if (dateNowHour.Equals(a) && dateNowMinute.Equals(b) && dateNowSecond.Equals(c)) { break; } } Clock?.Invoke(this); }