private void SuccessAlarm()
        {
            TurnOffSoundAndVibration();

            countDownForFailed?.Cancel();

            IsSuccess = true;

            var successStack = Preferences.Get("SuccessStack", 0);

            Preferences.Set("SuccessStack", successStack + 1);

            ShowResultDialog();
        }
        private void SetLaterAlarm(int minutes)
        {
            var alarmTime = SetLaterAlarmAndGetLaterAlarmTime(minutes);

            AlarmHelper.SetLaterAlarm(alarm);
            //AlarmController.SetLaterAlarmByManager(alarm, (long)diffTimeSpan.TotalMilliseconds);

            alarmService.SaveAlarmAtLocal(alarm);

            countDownForFailed.Cancel();

            Toast.MakeText(ApplicationContext, CreateDateString.CreateTimeRemainingString(alarmTime), ToastLength.Long).Show();

            NotificationAndroid.NotifyLaterAlarm(alarm, Intent);
        }
 public void OnClick(View v)
 {
     mCountDown.Cancel();
     if (index < totalQuestion)
     {
         Button btnClicked = (Button)v;
         if (btnClicked.Text.Equals(questions[index].CorrectAnswer))
         {
             score += 10;
             correctAnswer++;
             ShowQuestion(++index);
         }
         else
         {
             ShowQuestion(++index);
         }
     }
     txtScore.Text = $"{score}";
 }
Exemple #4
0
        private async Task ManageButtons(object sender)
        {
            _timer.Cancel();
            var backgroundCorrect = GetDrawable(Resource.Drawable.button_correct);
            var backgroundError   = GetDrawable(Resource.Drawable.button_error);
            var button            = sender as Button;

            if (button != null)
            {
                if (button.Text == _currentItem.GetCorrectAnswer())
                {
                    _correctAnswersCount++;
                    button.Background = backgroundCorrect;
                }
                else
                {
                    button.Background = backgroundError;
                    var correctButton = GetCorrectButton();
                    correctButton.Background = backgroundCorrect;
                }
            }

            await Execute(HandleTimer, 2000);
        }
Exemple #5
0
 private void StopMeasure()
 {
     _log.Print("正在取消...");
     CountDown.Cancel();
     bwMeasure.CancelAsync();
 }