0

I am trying to list the project collections of a tfs server. I am only connected to one of the three collections and I am using this method :

ReadOnlyCollection<CatalogNode> collectionsNodes = 
    configurationServer.CatalogNode.QueryChildren(
        new[] {CatalogResourceTypes.ProjectCollection },
        false, CatalogQueryOptions.None);

But this block returns three collections, not only the one I am connected to. Is there a way to list only the collections I am connected to ?

user1594047
  • 181
  • 1
  • 1
  • 12

1 Answers1

0

The configurationServer isn't connected to a particular collection. It's directly used to get this information from the TFS server. If you just want to list the collection you're connected to just use the data from the Collection object

MBulava
  • 521
  • 3
  • 9
  • yes but how in the Collection pbject check if I am connected ? – user1594047 May 16 '13 at 19:16
  • How could you be connected to a Collection if you haven't create something? Using the API you create a `TfsTeamProjectCollection` object to connect to one collection, but you could be connected to all Collections at one time. You can check if you are a valid user by creating a `TfsTeamProjectCollection tpc = new TfsTeamProjectCollection (collectionsNodes[0].whatYouNeed)` and than call `tpc.Authenticate()` – MikeR May 17 '13 at 07:00