IVsUIHierarchy Interface

Redirects commands you invoke to the appropriate hierarchy window instead of the standard command handler.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

public interface IVsUIHierarchy : IVsHierarchy

The IVsUIHierarchy type exposes the following members.

Public methodAdviseHierarchyEventsAllows clients to hook up for event notifications without making the hierarchy implement IConnectionPointContainer.
Public methodCloseCloses and cleans up a hierarchy once the environment determines that it is no longer used.
Public methodExecCommandExecutes a command on a specific item within a UI hierarchy window, or on the hierarchy itself.
Public methodGetCanonicalNameUsed for workspace persistence, for example, for remembering window positions.
Public methodGetGuidPropertyIdentifies the "type" of a particular node.
Public methodGetNestedHierarchyMakes it possible for a node of a given hierarchy to be a shortcut to the middle of another hierarchy.
Public methodGetPropertyGets properties of a given node or of the hierarchy.
Public methodGetSiteGets the service provider from which to access the services.
Public methodParseCanonicalNameReturns the identifier of the hierarchy item, given its canonical name.
Public methodQueryCloseDetermines whether the given hierarchy can be closed.
Public methodQueryStatusCommandQueries the object for the command status.
Public methodSetGuidPropertySets properties whose values are GUIDs.
Public methodSetPropertySets properties of a specific node or of the hierarchy.
Public methodSetSiteSets the service provider from which to access the services.
Public methodUnadviseHierarchyEventsDisables client notification of hierarchy events without requiring that the hierarchy implement IConnectionPointContainer.
Public methodUnused0Unused. Return E_NOTIMPL.
Public methodUnused1Unused. Return E_NOTIMPL.
Public methodUnused2Unused. Return E_NOTIMPL.
Public methodUnused3Unused. Return E_NOTIMPL.
Public methodUnused4Unused. Return E_NOTIMPL.

When the hierarchy window has focus, any commands that you implement are sent to the hierarchy window instead of to the standard command-handling interface, IOleCommandTarget, which does not support hierarchies. IVsUIHierarchy is similar to IOleCommandTarget in terms of functionality, but also provides information about the item that is currently selected in the hierarchy, based on the value of VSITEMID.

Commands that you want to use from outside of the hierarchy window, such as adding a project item, should not be handled by the IVsUIHierarchy methods. Only use the IVsUIHierarchy interface to handle the following types of commands:

  • Commands that require the UI Hierarchy window to have focus.

  • Commands that act on a specific item within the hierarchy. (If ItemID equals VSITEMID_SELECTION, the command is applied to the selected item or items.)

Handle all other commands related to the active hierarchy with the IOleCommandTarget interface.

Tool tips in a UI hierarchy window are reserved to show the full caption of the node if the caption is being clipped by the current view (i.e. the window is too narrow to show the full caption). You can not provide custom tool tips for UI hierarchy windows.

Notes to Implementers

Implemented by VSPackage writers to handle commands such as Cut, Copy, Paste, Delete, and Rename sent to the hierarchy window.

Community Additions