HierarchyNode.ExecCommandIndependentOfSelection Method
Executes commands that do not depend on what is selected.
Namespace: Microsoft.VisualStudio.Package
Assembly: MPF.Project.NonShipping (in MPF.Project.NonShipping.dll)
Syntax
'宣言
Protected Overridable Function ExecCommandIndependentOfSelection ( _
guidCmdGroup As Guid, _
cmdId As UInteger, _
cmdExecOpt As UInteger, _
vaIn As IntPtr, _
vaOut As IntPtr, _
commandOrigin As CommandOrigin, _
<OutAttribute> ByRef handled As Boolean _
) As Integer
'使用
Dim guidCmdGroup As Guid
Dim cmdId As UInteger
Dim cmdExecOpt As UInteger
Dim vaIn As IntPtr
Dim vaOut As IntPtr
Dim commandOrigin As CommandOrigin
Dim handled As Boolean
Dim returnValue As Integer
returnValue = Me.ExecCommandIndependentOfSelection(guidCmdGroup, _
cmdId, cmdExecOpt, vaIn, vaOut, commandOrigin, _
handled)
protected virtual int ExecCommandIndependentOfSelection(
Guid guidCmdGroup,
uint cmdId,
uint cmdExecOpt,
IntPtr vaIn,
IntPtr vaOut,
CommandOrigin commandOrigin,
out bool handled
)
protected:
virtual int ExecCommandIndependentOfSelection(
Guid guidCmdGroup,
unsigned int cmdId,
unsigned int cmdExecOpt,
IntPtr vaIn,
IntPtr vaOut,
CommandOrigin commandOrigin,
[OutAttribute] bool% handled
)
protected function ExecCommandIndependentOfSelection(
guidCmdGroup : Guid,
cmdId : uint,
cmdExecOpt : uint,
vaIn : IntPtr,
vaOut : IntPtr,
commandOrigin : CommandOrigin,
handled : boolean
) : int
Parameters
guidCmdGroup
Type: System.GuidThe GUID of the command group to which the command belongs.
cmdId
Type: System.UInt32The ID of the command.
cmdExecOpt
Type: System.UInt32Values taken from the OLECMDEXECOPT enumeration, which describe how the object should execute the command.
vaIn
Type: System.IntPtrPointer to a VARIANTARG structure that contains input arguments. Can be a null reference (Nothing in Visual Basic).
vaOut
Type: System.IntPtrPointer to a VARIANTARG structure that contains command output. Can be a null reference (Nothing in Visual Basic).
commandOrigin
Type: Microsoft.VisualStudio.Package.CommandOriginThe CommandOrigin value. Can be either UiHierarchy or OleCommandTarget.
handled
Type: System.Boolean%Indicates whether the command was handled.
Return Value
Type: System.Int32
If a command is not supported without a selection, returns OLECMDERR_E_NOTSUPPORTED(). Otherwise, returns the error status of the commands called by this method.
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.