IVsHierarchy Interface
Provides hierarchy management for VSPackages that implement project hierarchies.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
'Declaration
<InterfaceTypeAttribute()> _
<GuidAttribute("59B2D1D0-5DB0-4F9F-9609-13F0168516D6")> _
Public Interface IVsHierarchy
'Usage
Dim instance As IVsHierarchy
[InterfaceTypeAttribute()]
[GuidAttribute("59B2D1D0-5DB0-4F9F-9609-13F0168516D6")]
public interface IVsHierarchy
[InterfaceTypeAttribute()]
[GuidAttribute(L"59B2D1D0-5DB0-4F9F-9609-13F0168516D6")]
public interface class IVsHierarchy
public interface IVsHierarchy
Remarks
The IVsHierarchy interface is a generic interface to a hierarchy of nodes. Each node, including the root node, can have arbitrary properties associated with it. Each node on the hierarchy object is identified using a cookie (VSITEMID), which indicates a particular node. This cookie is invisible to the consumer of IVsHierarchy, and is typically a pointer to some private data maintained by the hierarchy's implementation.
A VSITEMID is a DWORD uniquely identifying a node within a hierarchy. Itemids from one IVsHierarchy may not be passed to another hierarchy. Also, note that itemids have a limited lifetime, as indicated by events fired by the hierarchy, so holding on to itemids for long durations will require either the sinking of these events, or the conversion of the itemid into a canonical, persistable form.
An item in a hierarchy can be a leaf node, a container of other items, or a link into some other hierarchy using GetNestedHierarchy.
The IVsHierarchy interface is not used only for project hierarchies. For example, the Server Explorer window implements the IVsHierarchy interface to display its hierarchy, which is not a project hierarchy.
There are times when it is useful to query a hierarchy about various virtual nodes, such as the hierarchy itself or the selected nodes within the hierarchy. Where such virtual nodes are potentially of interest, one of the predefined VSITEMID values may be passed.
The Visual Studio environment views a project as a hierarchy. A hierarchy is a tree of nodes that is a graphical representation of the project items, their relationships, and their associated properties. Every node also has a set of associated properties.
Notes to Implementers:
Implemented by VSPackages that create their own project hierarchy.
Notes to Callers:
Called by the environment to get and set hierarchy properties.