Example #1
0
        private void OnLeavingBackground(object sender, LeavingBackgroundEventArgs e)
        {
            if (CurrentTimer != null)
            {
                CurrentTimer.CheckTime();
            }

            if (IsTimerInProgress)
            {
                NotificationManager.Current.RemoveAllNotificationsButFirst(IsInPomodoro, CurrentTimer.StartTime + CurrentTimer.TotalTime);
            }
        }
        private async void OnLeavingBackground(object sender, LeavingBackgroundEventArgs e)
        {
            if (CurrentTimer != null && IsTimerInProgress)
            {
                CurrentTimer.CheckTime();
            }

            if (IsTimerInProgress)
            {
                NotificationManager.Current.RemoveAllNotificationsButFirst(IsInPomodoro, CurrentTimer.StartTime + CurrentTimer.TotalTime);
                await DataService.RemoveFuturePeriodsAsync();
            }
        }
        private async void OnLeavingBackground(object sender, LeavingBackgroundEventArgs e)
        {
            try
            {
                if (CurrentTimer != null && IsTimerInProgress)
                {
                    CurrentTimer.CheckTime();
                }

                if (IsTimerInProgress)
                {
                    await NotificationManager.Current.RemoveAllNotificationsButFirstAsync(IsInPomodoro, CurrentTimer.StartTime + CurrentTimer.TotalTime);

                    await DataService.RemoveFuturePeriodsAsync();
                }
            }
            catch (Exception ex)
            {
                Microsoft.AppCenter.Crashes.Crashes.TrackError(ex);
            }
        }