Example #1
0
 private void CloseConfirmationModal()
 {
     lock (_inactivityProcessingLock)
     {
         if (_currentInactivityModalModel != null)
         {
             _currentInactivityModalModel.IgnoreCountdown();
             _currentInactivityModalModel.ModalContext.CloseModalAsync();
             _currentInactivityModalModel = null;
         }
     }
 }
Example #2
0
        private Task ShowInactivityConfirmationModal()
        {
            return(ModalManager.Current.ShowModalAsync(new ModalArgs(
                                                           "InactivityConfirmationModal_Question",
                                                           modalContext =>
            {
                lock (_inactivityProcessingLock)
                {
                    // check if tracking has been stopped in parallel
                    if (_inactivityBehavior == null)
                    {
                        throw new OperationCanceledException($"Inactivity modal has been interrupted by '{nameof(StopTracking)}'.");
                    }

                    _currentInactivityModalModel = new InactivityConfirmationModalModel(modalContext, _inactivityBehavior.ModalDurationSecs, OnConfirmationModalCountdownRunOut);
                    var modal = _inactivityViewProvider.GetInactivityConfirmationModalWithStartedCountdown(_currentInactivityModalModel);
                    Assure.CheckFlowState(modal != null, $"'{nameof(IInactivityViewProvider)}.{nameof(IInactivityViewProvider.GetInactivityConfirmationModalWithStartedCountdown)}' has returned null.");
                    return modal;
                }
            },
                                                           centerTitleHorizontally: true,
                                                           showCancelButton: false)));
        }