TFS SDK: List the areas
You access the areas via the Project’s AreaRootNodes properties.
The areas are hierachical, you have a collection of nodes that have children.
A example that return a flat list of all areas hierarchy:
public IList<string> GetAreaPaths(Project project) { List<string> areas = new List<string>(); foreach (Node node in project.AreaRootNodes) AddChildren(string.Empty, node, this.areas); return areas; } private void AddChildren(string prefix, Node node, List<string> items) { items.Add(node.Path); foreach (Node item in node.ChildNodes) AddChildren(prefix + node.Name + "/", item, items); }
Comments (0)
Trackbacks (0)
Leave a comment
Trackback