Пример #1
0
        private async void BoxScoreList_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            if (e.Position >= 0 && e.Position < _boxScoreUrls?.Length)
            {
                var boxScore = _boxScoreUrls[e.Position];

                try
                {
                    var reddit = await _client.GetRedditAsync(new PlayRequest
                    {
                        Season   = _model.Year,
                        Week     = _model.Filter.Week,
                        AwayCode = boxScore.AwayCode,
                        HomeCode = boxScore.HomeCode,
                        GameId   = boxScore.GetGameId()
                    }).ConfigureAwait(true);

                    var returnIntent = new Intent();
                    returnIntent.PutExtra(ResultData, reddit);

                    if (reddit?.Length > 0)
                    {
                        returnIntent.PutExtra(ResultName, FileNameBuilder.GetFileName(reddit[0], _model.Year, _model.Filter.Week));
                    }
                    SetResult(Result.Ok, returnIntent);

                    Finish();
                }
                catch (Exception ex) when
                (
                    ex is HttpRequestException ||
                    ex is System.OperationCanceledException
                )
                {
                    AlertHelper.ShowException(this, ex);
                }
            }
        }