private void DisableSubOnly()
        {
            try
            {
                lock (_commandLockObject)
                {
                    _downloadService.Pause();

                    if (!_downloadService.CanShutdown())
                    {
                        MessageBoxResult result = _dialogService.ShowMessageBox("Do you want to abort all running downloads and disable sub-only support?", "Active Downloads", MessageBoxButton.YesNo, MessageBoxImage.Warning);

                        if (result == MessageBoxResult.No)
                        {
                            _downloadService.Resume();
                            return;
                        }
                    }

                    _downloadService.Shutdown();

                    _authService.RevokeAuthenticationSubOnly();
                    _navigationService.ShowSubOnlyAuth();
                }
            }
            catch (Exception ex)
            {
                _dialogService.ShowAndLogException(ex);
            }
        }
Esempio n. 2
0
        private void RevokeAuthentication()
        {
            try
            {
                lock (_commandLockObject)
                {
                    _downloadService.Pause();

                    MessageBoxResult?result = null;

                    if (_downloadService.CanShutdown())
                    {
                        result = _dialogService.ShowMessageBox("Do you really want to logout?", "Logout", MessageBoxButton.YesNo, MessageBoxImage.Question);
                    }
                    else
                    {
                        result = _dialogService.ShowMessageBox("Do you want to abort all running downloads and logout?", "Logout", MessageBoxButton.YesNo, MessageBoxImage.Warning);
                    }

                    if (result == MessageBoxResult.Yes)
                    {
                        _downloadService.Shutdown();
                        _authService.RevokeAuthentication();
                        _navigationService.ShowAuth();
                    }
                    else
                    {
                        _downloadService.Resume();
                    }
                }
            }
            catch (Exception ex)
            {
                _dialogService.ShowAndLogException(ex);
            }
        }