public ProjectViewModel(ITfProject model) { _model = model; _model.RepositoriesUpdated += (sender, args) => OnRepositoriesUpdated(); Repositories = new ObservableCollection <RepositoryViewModel>(); }
public Task <IEnumerable <ITfGitRepository> > GetRepositoriesInProject(ITfProject project) { var task = Task.Run(() => { var getRepositoriesTask = _gitHttpClient.Value.GetRepositoriesAsync(project.Id); getRepositoriesTask.Wait(); return(getRepositoriesTask.Result.Select(repo => _repositoryFactory.Create(repo, project))); }); return(task); }
public Task <IEnumerable <IPullRequest> > GetActivePullRequestsInProject(ITfProject project) { var task = Task.Run(() => { var getPullRequestsTask = _gitHttpClient.Value.GetPullRequestsByProjectAsync(project.Id, ActivePullRequestSearchCriteria); getPullRequestsTask.Wait(); var result = new List <IPullRequest>(); foreach (var pullRequest in getPullRequestsTask.Result) { var repo = project.Repositories.FirstOrDefault(rep => rep.Id == pullRequest.Repository.Id) ?? _repositoryFactory.Create(pullRequest.Repository, project); result.Add(_pullRequestFactory.Create(pullRequest, _serverConnection.Uri.AbsoluteUri, repo)); } return(result.AsEnumerable()); }); return(task); }
public TfGitRepository(GitRepository gitRepository, ITfProject project) { _gitRepository = gitRepository; Project = project; }