TFS API The All New Team Project Picker – Beautiful!
Posted
by Tarun Arora
on Geeks with Blogs
See other posts from Geeks with Blogs
or by Tarun Arora
Published on Wed, 11 Apr 2012 21:49:00 GMT
Indexed on
2012/04/12
5:30 UTC
Read the original article
Hit count: 233
The Team Project Picker in TFS 2011 looks gorgeous. I specially like the status bar on the working state, at least let’s you know that the project picker is still working on getting the details and of course the new icons for team project collection and team projects are stunning too.
How do I get the Team Project Picker using the TFS API?
That is fairly straight forward. Add a reference to the Microsoft.TeamFoundation.Client dll available in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ReferenceAssemblies\v2.0 and use the below code,
public void ConnectToTfs() { TeamProjectPicker tfsPP = new TeamProjectPicker(TeamProjectPickerMode.MultiProject, false, new UICredentialsProvider()); tfsPP.ShowDialog(); } |
Download a sample application here
Why does my project picker look different?
You might run into an issue, where the project picker looks like the below,
When the Team Project Picker is run from inside of VS the colour theme will be picked up from VS itself. When running outside of VS the windows theme colours are used, so there can be differences between the two. Currently there isn’t a way to change that since the dialog itself is not public (just the wrapper that launches the dialog). So don’t be surprised if the Team Project Picker looks different then expected :-]
© Geeks with Blogs or respective owner