HierarchyNode.DisplayContextMenu Method
Shows the shortcut menu for the specified nodes.
Namespace: Microsoft.VisualStudio.Package
Assembly: MPF.Project.NonShipping (in MPF.Project.NonShipping.dll)
Syntax
'宣言
Protected Overridable Function DisplayContextMenu ( _
selectedNodes As IList(Of HierarchyNode), _
pointerToVariant As IntPtr _
) As Integer
'使用
Dim selectedNodes As IList(Of HierarchyNode)
Dim pointerToVariant As IntPtr
Dim returnValue As Integer
returnValue = Me.DisplayContextMenu(selectedNodes, _
pointerToVariant)
protected virtual int DisplayContextMenu(
IList<HierarchyNode> selectedNodes,
IntPtr pointerToVariant
)
protected:
virtual int DisplayContextMenu(
IList<HierarchyNode^>^ selectedNodes,
IntPtr pointerToVariant
)
protected function DisplayContextMenu(
selectedNodes : IList<HierarchyNode>,
pointerToVariant : IntPtr
) : int
Parameters
selectedNodes
Type: System.Collections.Generic.IList<HierarchyNode>The list of selected nodes.
pointerToVariant
Type: System.IntPtrPointer to a [VARIANTARG] structure that contains the position of the shortcut menu.
Return Value
Type: System.Int32
If no nodes are selected or pointerToVariant is [System.IntPtr.Zero], returns OLECMDERR_E_NOTSUPPORTED(). Otherwise, it returns the error status of [M:Microsoft.VisualStudio.Package.HierarchyNode.ShowContextMenu(int menuID, Guid groupGuid, POINTS points)] for the appropriate shortcut menu.
Remarks
If only one node is selected or if multiple nodes of the same type are selected, this method shows the shortcut menu that is associated with that type of node. If multiple nodes of different types are selected and one of them is a project node, it shows the project shortcut menu. Otherwise, it shows the multi-select shortcut menu.
Permissions
- 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.