3

TFS からコレクションを取得する方法については、こちらを参照してください

詳しくはこちらをご覧ください。これは、TFS に関する最高のリソースの 1 つです。

4

2 に答える 2

3

コレクション GUID が渡され、リストはその特定のコレクション内のすべてのプロジェクトの名前を返します。

    public IList<string> GetProjectsFormCollection(Guid collectionId)
{
    ICommonStructureService structureService = null;
    try
    {
        TfsTeamProjectCollection teamProjectCollection =
            _configurationServer.GetTeamProjectCollection(collectionId);
        teamProjectCollection.Authenticate();
        structureService =
            (ICommonStructureService)teamProjectCollection.GetService(typeof(ICommonStructureService));
    }
    catch (Exception e)
    {
        ApplicationLogger.Log(e);
    }

    var projectInfoList = new List<ProjectInfo>(structureService.ListAllProjects());
    IEnumerable<string> data = projectInfoList.Select(proj => proj.Name);
    List<string> list = data.ToList();
    return list;
}
于 2013-04-19T09:37:38.570 に答える