TFS API Part 1: Domain Picker

12/01/2009

no comments

TFS API Part 1: Domain Picker

When creating application for TFS the first thing you need to do is connect to TFS.
There is couple of ways to do that, in this post I’ll show how to connect TFS using DomainPicker.

First add reference for Microsoft.TeamFoundation,Microsoft.TeamFoundation.Client
located in – C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\

Add using for Proxy and Server.

Download Demo Project

using Microsoft.TeamFoundation.Proxy;

using Microsoft.TeamFoundation.Server;

DomainProjectPicker dp = new DomainProjectPicker();

 

DomainProjectPicker constructor can contain DomainProjectPickerMode Enumeration.

#DomainProjectPickerMode

DomainProjectPickerMode.AllowMultiSelect;

DomainProjectPickerMode.AllowProjectSelect;//Requires AllowMultiSelect

DomainProjectPickerMode.DisableServerSelect;//Must provide SelectedServer

image

 

DomainProjectPickerMode.ForwardWndMsgOutsideVS;

DomainProjectPickerMode.None;

#

 

dp.ShowDialog();

 

image

 

After selecting TFS server and the desire project you can take those projects with ProjectInfo

if (dp.SelectedServer != null)

{

    ProjectInfo[] projects = dp.SelectedProjects;

    list_projects.DataSource = projects;

}

 

image

Download Demo Project

Add comment
facebook linkedin twitter email

Leave a Reply