HierarchyNode.ExecCommand Method
Executes the specified command on the specified item in a UI hierarchy window, or on the hierarchy itself.
Namespace: Microsoft.VisualStudio.Package
Assembly: MPF.Project.NonShipping (in MPF.Project.NonShipping.dll)
Syntax
'宣言
Public Overridable Function ExecCommand ( _
itemId As UInteger, _
ByRef guidCmdGroup As Guid, _
nCmdId As UInteger, _
nCmdExecOpt As UInteger, _
pvain As IntPtr, _
p As IntPtr _
) As Integer
'使用
Dim instance As HierarchyNode
Dim itemId As UInteger
Dim guidCmdGroup As Guid
Dim nCmdId As UInteger
Dim nCmdExecOpt As UInteger
Dim pvain As IntPtr
Dim p As IntPtr
Dim returnValue As Integer
returnValue = instance.ExecCommand(itemId, _
guidCmdGroup, nCmdId, nCmdExecOpt, _
pvain, p)
public virtual int ExecCommand(
uint itemId,
ref Guid guidCmdGroup,
uint nCmdId,
uint nCmdExecOpt,
IntPtr pvain,
IntPtr p
)
public:
virtual int ExecCommand(
unsigned int itemId,
Guid% guidCmdGroup,
unsigned int nCmdId,
unsigned int nCmdExecOpt,
IntPtr pvain,
IntPtr p
)
public function ExecCommand(
itemId : uint,
guidCmdGroup : Guid,
nCmdId : uint,
nCmdExecOpt : uint,
pvain : IntPtr,
p : IntPtr
) : int
Parameters
itemId
Type: System.UInt32Identifier of the item that is affected by the command passed to IVsUIHierarchy. Valid values are VSITEMID_NIL, VSITEMID_ROOT, and VSITEMID_SELECTION. For single selection, this value is the actual item ID. For multiple selections, set itemid equal to VSITEMID_SELECTION.
guidCmdGroup
Type: System.Guid%Unique identifier of the command group.
nCmdId
Type: System.UInt32The command to be executed. This command must belong to the group specified with guidCmdGroup.
nCmdExecOpt
Type: System.UInt32Values taken from the OLECMDEXECOPT enumeration. The values describe how the object should execute the command.
pvain
Type: System.IntPtrPointer to a [VARIANTARG] structure that contains input arguments. Can be a null reference (Nothing in Visual Basic).
p
Type: System.IntPtrPointer to a [VARIANTARG] structure to receive command output. Can be a null reference (Nothing in Visual Basic).
Return Value
Type: System.Int32
This method supports the standard return values E_FAIL and E_UNEXPECTED, and also the following values.
S_OK
The command was executed successfully.OLECMDERR_E_UNKNOWNGROUP
The guidCmdGroup parameter is not a null reference (Nothing in Visual Basic), but does not specify a recognized command group.OLECMDERR_E_NOTSUPPORTED
The nCmdId parameter is not a valid command in the group that is identified by guidCmdGroup.OLECMDERR_E_DISABLED
The command identified by nCmdId is currently disabled and cannot be executed.OLECMDERR_E_NOHELP
The caller has asked for help on the command identified by nCmdId, but no help is available.OLECMDERR_E_CANCELED
The user canceled the execution of the command.
Implements
IVsUIHierarchy.ExecCommand(UInt32, Guid%, UInt32, UInt32, IntPtr, IntPtr)
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.