Visual Studio 2008 Extensibility Development (VI): Operating solution Explorer

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.