Mohamed Mahmoud (El-Geish)



Add to Windows Live Alerts

How to: Query all labels on a folder recursively?

To do this, you can't call query labels with a wildcard character, you need to do the following:
 
- Get all items blow $/Dir1 using GetItems
- Loop through them calling QueryLabels on each one.
 
Here's a code snippet:

VersionControlServer sc = tfs.GetService<VersionControlServer>();
List<VersionControlLabel> labels = new List<VersionControlLabel>(); 

foreach (Item i in sc.GetItems("$/Proj"RecursionType.Full).Items)
{
   labels.AddRange(sc.QueryLabels(nullnullnullfalse, i.ServerItem, null));
}

Published Thursday, April 30, 2009 12:49 AM by mohamedg
Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

How to: Query all labels on a folder recursively? | ASP NET Hosting said:

April 30, 2009 1:21 AM
 

Team System News said:

Mohamed Mahmoud on How to: Query all labels on a folder recursively Brian Harry on Power Tool for Profiling

May 6, 2009 11:57 AM
 

Max Shoes said:

I think I will try to recommend this post to my friends and family, cuz it’s really helpful.

September 22, 2009 12:11 PM

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required
Submit

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker