private string[] GetTeamProjectsInternal() { using (var collection = TfsActionBase.GetTeamProjectCollection(this)) { var structureService = collection.GetService <ICommonStructureService>(); return(structureService.ListProjects().Select(p => p.Name).ToArray()); } }
private string[] GetBuildDefinitionsInternal(string teamProject) { using (var collection = TfsActionBase.GetTeamProjectCollection(this)) { var buildService = collection.GetService <IBuildServer>(); return(buildService.QueryBuildDefinitions(teamProject).Select(d => d.Name).ToArray()); } }
private string TestConnectionInternal() { try { using (var collection = TfsActionBase.GetTeamProjectCollection(this)) { collection.EnsureAuthenticated(); } return(null); } catch (Exception ex) { return(ex.Message); } }
private TfsBuildInfo GetBuildInfoInternal(string teamProject, string buildDefinition, string buildNumber, bool includeUnsuccessful) { using (var collection = TfsActionBase.GetTeamProjectCollection(this)) { var buildService = collection.GetService <IBuildServer>(); var spec = buildService.CreateBuildDetailSpec(teamProject, AH.CoalesceString(buildDefinition, "*")); spec.BuildNumber = AH.CoalesceString(buildNumber, "*"); spec.MaxBuildsPerDefinition = 1; spec.QueryOrder = BuildQueryOrder.FinishTimeDescending; spec.Status = includeUnsuccessful ? (BuildStatus.Failed | BuildStatus.Succeeded | BuildStatus.PartiallySucceeded) : BuildStatus.Succeeded; var result = buildService.QueryBuilds(spec).Builds.FirstOrDefault(); if (result != null) { return(new TfsBuildInfo(result)); } else { return(null); } } }