예제 #1
0
 private void timer_Tick(object sender, EventArgs e)
 {
     if (OnCountDown())
     {
         HourArea.Text   = processCount.GetHour();
         MinuteArea.Text = processCount.GetMinute();
         SecondArea.Text = processCount.GetSecond();
     }
     else
     {
         using (SoundPlayer player = new SoundPlayer())
         {
             player.SoundLocation = System.Environment.CurrentDirectory + "//Notify_Timeup.wav";
             player.Play();
         }
         countDownTimer.Stop();
     }
 }
 private void timer_Tick(object sender, EventArgs e)
 {
     if (OnCountDown())
     {
         HourArea.Text   = processCount.GetHour();
         MinuteArea.Text = processCount.GetMinute();
         SecondArea.Text = processCount.GetSecond();
     }
     else
     {
         using (SoundPlayer player = new SoundPlayer())
         {
             player.SoundLocation = System.Environment.CurrentDirectory + "//Notify_Timeup.wav";
             player.Play();
         }
         countDownTimer.Stop();
         ExternalFunctions.OnKeyDown((uint)asciiEncoding.GetBytes("S")[0]);
         MessageBox.Show("时间到了,请起身休息一下:)");
     }
 }