Makes it possible for a node of a given hierarchy to be a shortcut to the middle of another hierarchy.
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
int GetNestedHierarchy( uint itemid, ref Guid iidHierarchyNested, out IntPtr ppHierarchyNested, out uint pitemidNested )
- Type: System.UInt32
[in] Item identifier of the node whose nested hierarchy information is requested. For a list of itemid values, see VSITEMID.
- Type: System.Guid
[in] Identifier of the interface to be returned in ppHierarchyNested. To implement, first get the object that represents the nested hierarchy and run QueryInterface on it to obtain the interface ID (IID). Then, pass the IID in with iidHierarchyNested. The result of the QueryInterface call goes into ppHierarchyNested.
- Type: System.IntPtr
[out, iid_is(iidHierarchyNested)] Pointer to the interface whose identifier was passed in iidHierarchyNested.
- Type: System.UInt32
[out] Pointer to an item identifier of the root node of the nested hierarchy. For a list of pitemidnested values, see VSITEMID. Although the interface is set up to support shortcutting to any node in another hierarchy, the environment currently only supports shortcutting to the root node of the nested hierarchy, in which case pitemidNested must be set to VSITEMID_ROOT.
Return ValueType: System.Int32
If itemid is not a nested hierarchy, this method returns E_FAIL. If the requested interface is not supported on the hierarchy object, E_NOINTERFACE is returned. The caller would then treat this node as if it had no children, if the requested interface had been essential (as is often the case when the requested interface is IID_IVsUIHierarchy).
Hierarchies can nest within other hierarchies. For example, you can create a parent hierarchy named Hierarchy 1. If Hierarchy 1 contains two items, Item A and Item B, with Item B being a nested hierarchy (named Hierarchy 2) the nested hierarchy has two identifiers:
Item B in Hierarchy 1
Root of Hierarchy 2
Use the IVsHierarchy::GetNestedHierarchy method to determine if a given hierarchy is a nested hierarchy. In the example above, you would specify the itemid corresponding to Item B in Hierarchy 1, and the method would return the root of Hierarchy 2. This method allows you to have two different hierarchies for implementation reasons even though to the user the nested hierarchy looks like a child of the parent hierarchy.
If the return value is E_NOINTERFACE and the requested interface is essential, as is often the case when the requested interface is IID_IVsUIHierarchy, the caller treats this node as if it has no child nodes and is not a nested hierarchy.
With nested hierarchies, the parent hierarchy can override the behavior of any of its nested hierarchies. Thus, if a command is executed on an item in the nested hierarchy, the parent hierarchy is allowed first chance at responding to that command.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.