コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }