这是TFS上最好的资源之一。私有TfsConfigurationServer配置服务器;configurationServer=TfsConfigurationServerFactory.GetConfigurationServer(uri);publicIList>GetCollections(){//ApplicationLogger.Log("进入GetCollections():");varcollectionList=new列表>();尝试{configurationServer.Authenticate();ReadOnlyCollectioncollectionNodes=configurationServer.CatalogNode.QueryChildren(new[]{CatalogResourceTypes.ProjectCollection},false,CatalogQueryOptions.None);foreach(CatalogNodecollectionNodeincollectionNodes){varcollectionId=newGuid(collectionNode.Resource.Properties["InstanceId"]);TfsTeamProjectCollectionteamProjectCollection=configurationServer.GetTeamProjectCollection(collectionId);如果(teamProjectCollection==null)继续;collectionList.Add(newKeyValuePair(collectionId,teamProjectCollection.Name));}}catch(Exceptione){ApplicationLogger.Log(e);}返回集合列表;}列表中的每个返回的键值对都包含集合guid和集合名称上面描述的就是C#学习教程:如何从TFS中获取所有集合共享的所有内容。如果对你有用,需要进一步了解C#学习教程,希望大家多多关注。本文收集自网络,不代表立场。如涉及侵权,请点击右侧联系管理员删除。如需转载请注明出处:
