Example #1
0
        public async void DownloadElements()
        {
            IsBusy = true;
            ClearData();

            try
            {
                DownloadProgress = -1;
                BoardContent     = await _jiraApi.Agile.GetBoardContent(Board.Id, _forceReload, p => DownloadProgress = p);

                Statistics = await _statisticsCalculator.Calculate(BoardContent.Issues);

                DownloadCompleted = true;
            }
            catch (CacheCorruptedException)
            {
                if (_forceReload)
                {
                    MessageBox.Show("Failed to download board data.", "JiraAssistant");
                    return;
                }
                MessageBox.Show("There were problems to save board data. We'll try to re-download it.", "Jira Assistant");

                _forceReload = true;
                DownloadElements();
            }
            catch (Exception e)
            {
                if (e is WebException && _jiraSession.IsLoggedIn == false)
                {
                    _logger.Trace("Download interrupted due to log out from JIRA.");
                    return;
                }

                _logger.Error(e, "Download failed for issues in board: {0} ({1})", Board.Name, Board.Id);
                ClearData();
                MessageBox.Show("Failed to retrieve issues belonging board: " + Board.Name, "Jira Assistant");
            }
            finally
            {
                IsBusy = false;
            }
        }
 private async void GatherStatistics()
 {
     Statistics = await _statisticsCalculator.Calculate(Issues);
 }