コード例 #1
0
        public void Update()
        {
            if (targetSeconds - teaTimer.ElapsedSeconds() <= 0.0 && teaTimer.isRunning)
            {
                if (!App.IsInForeground)
                {
                    notificationService.CreateNotification(timerViewModel.TeaName, timerViewModel.teaType, (int)infNum);
                }
                else
                {
                    notificationService.CancelNotification();
                }

                teaTimer.Clear();
                timerViewModel.InfNum = infNum.ToString();
                timerViewModel.formatTimerNum(0.0);
                timerViewModel.IsBusy = false;
                alarmPlayer.Play();
            }

            if (teaTimer.isRunning)
            {
                timerViewModel.formatTimerNum(targetSeconds - teaTimer.ElapsedSeconds());
            }
        }
コード例 #2
0
 /// <summary>
 /// Cancels a specific notification
 /// </summary>
 /// <param name="requestCode">The ID of the notification to cancel</param>
 public static void CancelNotification(int requestCode)
 {
     notification.CancelNotification(requestCode);
 }