public static ICollection <BuildServiceHostDefinition> GetAllBuildServiceHosts(TfsTeamProjectCollection tpc) { List <BuildServiceHostDefinition> buildServiceHostCollection = new List <BuildServiceHostDefinition>(); IBuildServer bs = tpc.GetService <IBuildServer>(); BuildServerHelper.FeedBuildMachineData(buildServiceHostCollection, bs); return(buildServiceHostCollection); }
public static ICollection <BuildServiceHostDefinition> GetAllBuildServiceHosts(TfsConfigurationServer configurationServer) { List <BuildServiceHostDefinition> buildServiceHostCollection = new List <BuildServiceHostDefinition>(); ITeamProjectCollectionService collectionService = configurationServer.GetService <ITeamProjectCollectionService>(); if (collectionService != null) { IList <TeamProjectCollection> collections = collectionService.GetCollections(); foreach (TeamProjectCollection collection in collections) { if (collection.State == TeamFoundationServiceHostStatus.Started) { TfsTeamProjectCollection tpc = configurationServer.GetTeamProjectCollection(collection.Id); buildServiceHostCollection.AddRange(BuildServerHelper.GetAllBuildServiceHosts(tpc)); } } } return(buildServiceHostCollection); }