示例#1
0
        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;
                }
            }
        }
示例#2
0
 void Clk_OnTick(object sender, TickEventArgs args)
 {
     Console.WriteLine("滴答");
 }
示例#3
0
        public void Tick()
        {
            TickEventArgs args = new TickEventArgs();

            OnTick(this, args);
        }
示例#4
0
 static void GoTick(object sender, TickEventArgs t)
 {
     Console.WriteLine(t.soundtick);
 }