Objective
In extensibility Development (v), I introduced the basic operations for solution, Project, and ProjectItem. They are considered to be the physical (file) representations of the solution content, and we need to manage them using the Solution Manager (Solution Explorer) provided with VS. There is no doubt that the solution manager is one of the most important UI elements in VS, and this article describes how to do it.
Hierarchy within the tool window
If you look at Solution Manager and Server Explorer, you'll find that they all use a tree structure to represent the data behind it. In AoM, UIHierarchy, UIHierarchyItems, and UIHierarchyItem are used to represent such hierarchies. UIHierarchy represents the root node, whose UIHierarchyItems collection represents the first-level child node (UIHierarchyItem) it contains, and each uihierarchyitem also has a UIHierarchyItems attribute. So recursively go on. This structure is much like the data they represent: Solution, Project, and ProjectItem. Before using these objects, get a rough idea of their main members:
1) UIHierarchy
Parent: Node object's parents node;
SelectedItems: The collection of child nodes selected by the current node;
UIHierarchyItems: A collection of child nodes of the current node;
DoDefaultAction (): The default action on the node, similar to the double-click or press ENTER;
GetItem (): Returns a child node by the specified path;
Selectdown (): Selects the next node of the currently selected node;
Selectup (): Selects the last node of the currently selected node;
For more information, please refer to MSDN.
2) UIHierarchyItems Collection
Expanded: Gets or sets whether the represented node is expanded;
Parent: A node set of nodes;
Item (): Returns an item in the collection;
For more information, please refer to MSDN.
3) UIHierarchyItem
IsSelected: Gets whether the node is selected;
Name: The names of the node objects;
Select (): select node;
For more information, please refer to MSDN.
With this knowledge, we now have the ability to explore the solution manager operation.