private void ReloadPullRequests() { if (_settings == null) { return; } ThreadHelper.JoinableTaskFactory.RunAsync(async() => { await TaskScheduler.Default; var pullRequests = await GetPullRequestsAsync(); await this.SwitchToMainThreadAsync(); lbxPullRequests.DataSource = pullRequests; lbxPullRequests.DisplayMember = nameof(PullRequest.DisplayName); }).FileAndForget(); async Task <List <PullRequest> > GetPullRequestsAsync() { var list = new List <PullRequest>(); var getPullRequests = new GetPullRequest(_settings.ProjectKey, _settings.RepoSlug, _settings); var result = await getPullRequests.SendAsync().ConfigureAwait(false); if (result.Success) { list.AddRange(result.Result); } return(list); } }
private List <PullRequest> GetPullRequests() { var list = new List <PullRequest>(); var getPullReqs = new GetPullRequest(_settings.ProjectKey, _settings.RepoSlug, _settings); var result = getPullReqs.Send(); if (result.Success) { list.AddRange(result.Result); } return(list); }
private async Task <List <PullRequest> > GetPullRequestsAsync() { var list = new List <PullRequest>(); var getPullReqs = new GetPullRequest(_settings.ProjectKey, _settings.RepoSlug, _settings); var result = await getPullReqs.SendAsync().ConfigureAwait(false); if (result.Success) { list.AddRange(result.Result); } return(list); }