Пример #1
0
        public void TimerDisplay()
        {
            if (timerCountsDown == 0 || timerCountsDown == 1)
            {
                sec--;
                if (sec < 0)
                {
                    sec = 59;
                    min--;
                }
            }
            else
            {
                sec++;
                if (sec > 59)
                {
                    min++;
                    sec = 0;
                }
            }

            if (min > 9)
            {
                zeroM = "";
            }
            else
            {
                zeroM = "0";
            }
            if (sec > 9)
            {
                zeroS = "";
            }
            else
            {
                zeroS = "0";
            }

            if (sec == 0 && min == 0 && timerCountsDown == 1)
            {
                timerCountsDown = 2;
            }

            else if (sec <= 30 && min == 0 && timerCountsDown == 0)
            {
                timerCountsDown = 1;
            }

            BigDigits.Foreground = DigitsColors.GetColorForTimeRemaining(timerCountsDown);
            BigDigits.Content    = string.Format("{0}{1}:{2}{3}", zeroM, min, zeroS, sec);
        }
Пример #2
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);
         }
     }
 }