Share via


UIHierarchy Interface

Definition

Represents standard tool windows in the integrated development environment (IDE) that use hierarchical trees of data, such as Solution Explorer or Server Explorer.

public interface class UIHierarchy
public interface class UIHierarchy
__interface UIHierarchy
[System.Runtime.InteropServices.Guid("72A2A2EF-C209-408C-A377-76871774ADB7")]
[System.Runtime.InteropServices.TypeLibType(4160)]
public interface UIHierarchy
[System.Runtime.InteropServices.Guid("72A2A2EF-C209-408C-A377-76871774ADB7")]
public interface UIHierarchy
[<System.Runtime.InteropServices.Guid("72A2A2EF-C209-408C-A377-76871774ADB7")>]
[<System.Runtime.InteropServices.TypeLibType(4160)>]
type UIHierarchy = interface
[<System.Runtime.InteropServices.Guid("72A2A2EF-C209-408C-A377-76871774ADB7")>]
type UIHierarchy = interface
Public Interface UIHierarchy
Attributes

Remarks

The UIHierarchy object provides a common object model for standard tool windows that present hierarchical data in a tree view. You can select items regardless of whether the expansion state of the tree shows the item. Selecting an item that is not shown in the current tree expansion causes the tree to expand to show the item.

You obtain this object by using Window.Object on any standard tree-view tool window.

Because the UIHierarchy object represents any tree view-type window, it is a Window object. Its UIHierarchyItems property returns the collection of top-level nodes in the specified window. In Solution Explorer, there is only a single top-level node, the solution.

Bearing this in mind, there are two ways to access a particular node (UIHierarchyItem):

  • Use the GetItem method to directly reference the desired node.

  • Use UIHierarchyItems.Item.UIHierarchyItems... (a collection/item/collection... pattern).

    To navigate deeper into a node nesting, keep using this pattern. For example, to navigate to the second node under the top-level node, use UIHierarchy.UIHierarchyItems.Item(1).UIHierarchyItems.Item(2).

Following are examples of how to use both techniques to access a lower-level node.

Properties

DTE

Gets the top-level extensibility object.

Parent

Gets the immediate parent object of a UIHierarchy object.

SelectedItems

Gets a collection of all of the currently selected items.

UIHierarchyItems

Gets a collection representing children of the item.

Methods

DoDefaultAction()

In the hierarchy, performs the same action as if the user had double-clicked or pressed ENTER.

GetItem(String)

Gets the item designated by given path.

SelectDown(vsUISelectionType, Int32)

Selects the node immediately below the currently selected node with respect to the tree's current expansion state.

SelectUp(vsUISelectionType, Int32)

Selects the node immediately above the currently selected node with respect to the tree's current expansion state.

Applies to