Paul Hacker's Blog

Musings from a "Hacker"
posts - 21, comments - 36, trackbacks - 22

My Links

News



Archives

Programmatically show the Connection Dialog for Team Foundation

I am always looking for new ways to work with and extend Team Foundation Server. I happen to be working on one such project and I had a need to access the Connection dialog box that is available in TFS. I made the assumption that I could show that dialog and utilize it rather than reinvent the wheel. It took me a bit, but I found out that you can use the DomainProjectPicker class to access the dialog.

The first thing I did was to set two private variables in my class

private TeamFoundationServer tfsServer;

private string tfsProjectName;

The following code returns me an instance of the picker. The constructor is overloaded so I can set the mode using the DomainProjectPickerMode enum. The enum gives me the five options, two of which are listed here.

  1. AllowMultiSelect - Lets the user select multiple projects
  2. AllowProjectSelect - - Lets the user select a project

I am using the AllowProjectSelect mode as I only want the user to be able to select one project from the list

DomainProjectPicker projectPicker = new DomainProjectPicker(DomainProjectPickerMode.AllowProjectSelect);

Now that I have an instance of the picker, I want to gleen some information from it that I will use in my project. I need to get the TFS server and the project name. First off I will show the dialog and if the user clicks OK I will gather up my info.

if (projectPicker .ShowDialog() == System.Windows.Forms.DialogResult.OK)

{

//get the selected server

tfsServer = projectPicker .SelectedServer;

//get the selected project name from the ProjectInfo array. I will use the 0 index since I am only allowing the user to

//select one project and use the Name property to get the actual project name.

Microsoft.TeamFoundation.Server.ProjectInfo[] projectInfo = projectPicker .SelectedProjects;

tfsProjectName = projectInfo [0].Name;

//Now I need to authenticate so tha I can use the server object later on

tfsServer.EnsureAuthenticated();

}

As you can see it is rather easy to take advantage of the connection dialog in your own projects that need to access TFS. Hope you find this useful.

Print | posted on Wednesday, August 02, 2006 9:29 PM |

Feedback

Gravatar

# VSTS Links - 08/03/2006

Randy Miller on Writing Scenarios: Part 1 Identification.

Brian Keller on Team Foundation Server:...
8/3/2006 6:58 AM | Team System News
Gravatar

# re: Programmatically show the Connection Dialog for Team Foundation


Top 10 best roulette system gambling casinos based on micro gaming platform.
Best blackjack strategy gambling casinos, play to win and enjoy your online
blackjack gambling experience.
Learn how to play casino video poker and experience the thrill of gambling and beating online

casinos.
Use a free poker websites to calculate your winning poker odds.
Learn the art of horse racing systems and play to win your punts at the races.
Dont buy movies, get downloading movies movies and watch them for free.
Earn money and work from home, with forex software, trade the forex market.
Get all sorts of iphone software downloads for your new iphone mobile telephone.
8/20/2008 12:29 AM | zoran
Gravatar

# re: Programmatically show the Connection Dialog for Team Foundation

What do we really mean bybuy Warhammer gold becoming open? Well,buy Warhammer gold trying to talk about yourself in such a way that Warhammer gold something of the inner person,Warhammer gold that is you, is communicated to others might be one way of being open or at least thinking about being open. aoc goldThat inner person is aoc golda complex person who has a variety of thoughts and also feelings. So,eq plat wanting to share with lord of the ring gold</aother people these inner feelings and these inner thoughts is one way of becoming open. lotr goldBeing open is a kind of invitation to others.EverQuest gold What you share about yourself should lotro goldencourage others to come in, so to speak and make contact with you. Maple Story MesosTo involve themselves with you. Being open is difficult.MapleStory mesos It makes us feel vulnerable, psychologically naked and usually anxious. But it also is important in terms of really Maple Story mesoletting others get to understand how we think, how we feel and what we believe.Maple Story Meso We often hide our inner thoughts and feelings because kamas dofuswe're concerned how well excepted they'll be by other people.maple Story Mesos But we also shut out other people from knowing and accepting us by not being open.MapleStory mesos We also are really saying we don't fully accept ourselves if we won't buy ffxi gilbe open with others. We're denying ourselves that chance to speak out, dofus kamasto declare our inner thoughts and feelings. Final Fantasy XI gilIt's up to you to decide just how you're lotro goldgoing to talk about yourself and what you're going to say. ffxi gilTelling somebody where you bought those new pair of shoes might be one way of being open. <br/>
11/11/2008 7:33 PM | DENG
Gravatar

# re: Programmatically show the Connection Dialog for Team Foundation

Physical force or threats may make children do as wow goldthey're told in the short term but their compliance will last only as long as wow goldthe threat is relevant. wow goldThen they will go back to doing what they wanted to do in the first place.
11/11/2008 7:35 PM | hobg
Gravatar

# re: Programmatically show the Connection Dialog for Team Foundation

<br>Fortunatelyage of conan goldit was never my goal to supplant their real father in their affection. age conan goldThey always called me Dan and were sweet to me,age of conan power leveling but there was a gap that would not close;aoc power leveling they were just a bit reluctant to engage in things with only me.age conan gold One day a couple of monthssintosour life together, anarchy online creditsthe kids and I were riding our bicycles around the neighborhood.anarchy online credit David started to fuss about being tired, then hungry,archlord gold then bored, and Jane provoked him by assuming an air of maternal superiority.buy archlord gold An argument broke out, and for the first time I spoke to them sternly. Listen, City of Heroes InfamyI said, you don't have to think of me as your father -coh influence I'm not interested in replacing him. But I am married to your mother.City of Villains infamy I know you didn't have any choice in this matter, but here we are, cov infamyliving together.Gaia Online Gold As an adult I have a responsibility to look out for your wellbeing,gaia gold which includesshavingssome fun together.ge money So I'm probably going to act like a parent until you're grown up.granado espada vis We might as well find ways to get along. So,granado espada gold right now, what do you want to do: go home or ride your bikes?They both chose to ride on, and we had a great time that afternoon.hellgate london palladium I think they were relieved to hear me say that I was not trying to replace their real father.<br/>
11/11/2008 7:36 PM | mei

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 8 and 5 and type the answer here:

Powered by: