-4
A
答えて
0
いくつかの例とすべての名前空間を持つthis official documentationをご覧ください。
以下の例は、Team Foundationを実行しているサーバーにプログラムで接続し、チームプロジェクトにアクセスしてプロジェクト情報を一覧表示する方法を示しています。ご参考のための複数のAPIサンプルを含む
using System;
using System.Collections.ObjectModel;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.Framework.Common;
using Microsoft.TeamFoundation.Framework.Client;
namespace TfsApplication
{
class Program
{
static void Main(String[] args)
{
// Connect to Team Foundation Server
// Server is the name of the server that is running the application tier for Team Foundation.
// Port is the port that Team Foundation uses. The default port is 8080.
// VDir is the virtual path to the Team Foundation application. The default path is tfs.
Uri tfsUri = (args.Length < 1) ?
new Uri("http://Server:Port/VDir") : new Uri(args[0]);
TfsConfigurationServer configurationServer =
TfsConfigurationServerFactory.GetConfigurationServer(tfsUri);
// Get the catalog of team project collections
ReadOnlyCollection<CatalogNode> collectionNodes = configurationServer.CatalogNode.QueryChildren(
new[] { CatalogResourceTypes.ProjectCollection },
false, CatalogQueryOptions.None);
// List the team project collections
foreach (CatalogNode collectionNode in collectionNodes)
{
// Use the InstanceId property to get the team project collection
Guid collectionId = new Guid(collectionNode.Resource.Properties["InstanceId"]);
TfsTeamProjectCollection teamProjectCollection = configurationServer.GetTeamProjectCollection(collectionId);
// Print the name of the team project collection
Console.WriteLine("Collection: " + teamProjectCollection.Name);
// Get a catalog of team projects for the collection
ReadOnlyCollection<CatalogNode> projectNodes = collectionNode.QueryChildren(
new[] { CatalogResourceTypes.TeamProject },
false, CatalogQueryOptions.None);
// List the team projects in the collection
foreach (CatalogNode projectNode in projectNodes)
{
Console.WriteLine(" Team Project: " + projectNode.Resource.DisplayName);
}
}
}
}
}
いくつかの素晴らしいブログ:
(サンプルはC++、まだ非常に便利ですが)関連する問題
- 1. Team Foundation Server qusion
- 2. Team Foundation Serverのチームスプリント
- 3. Team Foundation Serverのロールアップタスク
- 4. Team Foundation Serverのスイッチ
- 5. Team Foundation Serverのインストール
- 6. Team Foundation Serverのマージマージ
- 7. Team Foundation Serverのアドイン
- 8. Team Foundation Serverビルドエラー.... NuGet?
- 9. Team Foundation Server 2010 DashBoard
- 10. Team Foundation Server - Backdate Epics
- 11. Team Foundation Server 2010 API
- 12. Team Foundation ServerとTeam Servicesの違い
- 13. のTeam Foundation Server 2010の - プロジェクト
- 14. のTeam Foundation Serverの2015は
- 15. のTeam Foundation Serverの2015
- 16. Team Foundation Serverのインストールとチュートリアル
- 17. ターゲットマシンのTeam Foundation Server(TFS)PowerShell
- 18. Team Foundation Server 2010のスクランボード?
- 19. Team Foundation ServerのJava通知
- 20. Team Foundation Serverビルドの制限
- 21. Team Foundation Server 2008のレポートテンプレート
- 22. 無料のオンラインTeam Foundation Server
- 23. Team Foundation ServerのWebアクセス
- 24. TFS(Team Foundation Server)Java SDK - ユーザーストーリーによるファイルの検索
- 25. Sharepoint - Project Web Access - Team Foundation Server
- 26. Team Foundation Server 2008ビルドサーバーコード分析
- 27. team foundation server 2012復元
- 28. リバースプロキシApacheとTeam Foundation Server
- 29. Team Foundation Server 2015(TFS)クエリ
- 30. WebサイトProject with Team Foundation Server