public void clockOn() { power = true; while (power) { timetick++; //打开时钟 Thread.Sleep(1000); //每一秒运行一次循环 TickEventArgs tick = new TickEventArgs(); tickHandler(this, tick); if (timetick == Alarmtime) { AlarmEventArgs alarm = new AlarmEventArgs(); alarmHandler(this, alarm); } if (timetick == 60) { power = false; } } }
void Clk_OnTick(object sender, TickEventArgs args) { Console.WriteLine("滴答"); }
public void Tick() { TickEventArgs args = new TickEventArgs(); OnTick(this, args); }
static void GoTick(object sender, TickEventArgs t) { Console.WriteLine(t.soundtick); }