示例#1
0
 private void PlayButton_Click(object sender, RoutedEventArgs e)
 {
     if (!timerStarted)
     {
         timerClock.Start();
         timerStarted       = true;
         PlayButton.Content = DisplaySettings.StopButtonImage();
         DisplaySettings.SetButtonStop(PlayButton);
         DisplaySettings.SetButtonDisable(PlusButton);
         DisplaySettings.SetButtonDisable(MinusButton);
         DisplaySettings.SetButtonDisable(ForwardButton);
         DisplaySettings.SetButtonDisable(ResetButton);
     }
     else
     {
         timerClock.Stop();
         timerStarted       = false;
         PlayButton.Content = DisplaySettings.StartButtonImage();
         DisplaySettings.SetButtonStart(PlayButton);
         DisplaySettings.SetButtonStart(PlusButton);
         DisplaySettings.SetButtonStart(MinusButton);
         DisplaySettings.SetButtonStart(ForwardButton);
         DisplaySettings.SetButtonStart(ResetButton);
         timerCountsDown = 0;
         if (meetingListPosition != meetingListPositionLength - 1)
         {
             meetingListPosition++;
             min                = meetingList.GetMeetingList()[meetingListPosition].minT;
             sec                = meetingList.GetMeetingList()[meetingListPosition].secT;
             pointName          = meetingList.GetMeetingList()[meetingListPosition].pointName;
             TitleLabel.Content = pointName;
             ShowDigits();
             BigDigits.Foreground = DigitsColors.GetColorForTimeRemaining(timerCountsDown);
         }
     }
 }
示例#2
0
 public void ShowDigits()
 {
     if (min == -1 && sec == -1)
     {
         zeroM = "0";
         min   = 0;
         zeroS = "0";
         sec   = 0;
         PlayButton.Content = DisplaySettings.StartButtonImage();
         DisplaySettings.SetButtonDisable(PlayButton);
         DisplaySettings.SetButtonDisable(PlusButton);
         DisplaySettings.SetButtonDisable(MinusButton);
         DisplaySettings.SetButtonDisable(ForwardButton);
         DisplaySettings.SetButtonDisable(ResetButton);
     }
     else
     {
         if (min > 9)
         {
             zeroM = "";
         }
         else
         {
             zeroM = "0";
         }
         if (sec > 9)
         {
             zeroS = "";
         }
         else
         {
             zeroS = "0";
         }
     }
     BigDigits.Content = string.Format("{0}{1}:{2}{3}", zeroM, min, zeroS, sec);
 }