コード例 #1
0
        public static ICollection <BuildServiceHostDefinition> GetAllBuildServiceHosts(TfsTeamProjectCollection tpc)
        {
            List <BuildServiceHostDefinition> buildServiceHostCollection = new List <BuildServiceHostDefinition>();
            IBuildServer bs = tpc.GetService <IBuildServer>();

            BuildServerHelper.FeedBuildMachineData(buildServiceHostCollection, bs);
            return(buildServiceHostCollection);
        }
コード例 #2
0
        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);
        }