private void ReloadRepositories()
        {
            if (_settings == null)
            {
                return;
            }

            ThreadHelper.JoinableTaskFactory.RunAsync(async() =>
            {
                await TaskScheduler.Default;
                var repositories = await GetRepositoriesAsync();

                await this.SwitchToMainThreadAsync();
                ddlRepositorySource.DataSource = repositories.ToList();
                ddlRepositoryTarget.DataSource = repositories.ToList();
                ddlRepositorySource.Enabled    = true;
                ddlRepositoryTarget.Enabled    = true;
            }).FileAndForget();

            async Task <List <Repository> > GetRepositoriesAsync()
            {
                var list           = new List <Repository>();
                var getDefaultRepo = new GetRepoRequest(_settings.ProjectKey, _settings.RepoSlug, _settings);
                var defaultRepo    = await getDefaultRepo.SendAsync().ConfigureAwait(false);

                if (defaultRepo.Success)
                {
                    list.Add(defaultRepo.Result);
                }

                return(list);
            }
        }
        private List <Repository> GetRepositories()
        {
            var list           = new List <Repository>();
            var getDefaultRepo = new GetRepoRequest(_settings.ProjectKey, _settings.RepoSlug, _settings);
            var defaultRepo    = getDefaultRepo.Send();

            if (defaultRepo.Success)
            {
                list.Add(defaultRepo.Result);
            }

            return(list);
        }
        private async Task <List <Repository> > GetRepositoriesAsync()
        {
            var list           = new List <Repository>();
            var getDefaultRepo = new GetRepoRequest(_settings.ProjectKey, _settings.RepoSlug, _settings);
            var defaultRepo    = await getDefaultRepo.SendAsync().ConfigureAwait(false);

            if (defaultRepo.Success)
            {
                list.Add(defaultRepo.Result);
            }

            return(list);
        }
Beispiel #4
0
        private List <Repository> GetRepositories()
        {
            var list           = new List <Repository>();
            var getDefaultRepo = new GetRepoRequest(_settings.ProjectKey, _settings.RepoSlug, _settings);
            var defaultRepo    = getDefaultRepo.Send();

            if (defaultRepo.Success)
            {
                list.Add(defaultRepo.Result);
            }
            //var getRelatedRepos = new GetRelatedRepoRequest(_settings);
            //var result = getRelatedRepos.Send();
            //if (result.Success)
            //{
            //    list.AddRange(result.Result);
            //}
            return(list);
        }