次の方法で共有


FlavoredProject.ExecCommand Method

Executes a command on a specific item within a UI hierarchy window, or on the hierarchy itself.

Namespace:  Microsoft.VisualStudio.Shell.Flavor
Assemblies:   Microsoft.VisualStudio.Shell.9.0 (in Microsoft.VisualStudio.Shell.9.0.dll)
  Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)
  Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)

Syntax

'宣言
Protected Overridable Function ExecCommand ( _
    itemid As UInteger, _
    ByRef pguidCmdGroup As Guid, _
    nCmdID As UInteger, _
    nCmdexecopt As UInteger, _
    pvaIn As IntPtr, _
    pvaOut As IntPtr _
) As Integer
'使用
Dim itemid As UInteger
Dim pguidCmdGroup As Guid
Dim nCmdID As UInteger
Dim nCmdexecopt As UInteger
Dim pvaIn As IntPtr
Dim pvaOut As IntPtr
Dim returnValue As Integer

returnValue = Me.ExecCommand(itemid, _
    pguidCmdGroup, nCmdID, nCmdexecopt, _
    pvaIn, pvaOut)
protected virtual int ExecCommand(
    uint itemid,
    ref Guid pguidCmdGroup,
    uint nCmdID,
    uint nCmdexecopt,
    IntPtr pvaIn,
    IntPtr pvaOut
)
protected:
virtual int ExecCommand(
    unsigned int itemid, 
    Guid% pguidCmdGroup, 
    unsigned int nCmdID, 
    unsigned int nCmdexecopt, 
    IntPtr pvaIn, 
    IntPtr pvaOut
)
abstract ExecCommand : 
        itemid:uint32 * 
        pguidCmdGroup:Guid byref * 
        nCmdID:uint32 * 
        nCmdexecopt:uint32 * 
        pvaIn:IntPtr * 
        pvaOut:IntPtr -> int 
override ExecCommand : 
        itemid:uint32 * 
        pguidCmdGroup:Guid byref * 
        nCmdID:uint32 * 
        nCmdexecopt:uint32 * 
        pvaIn:IntPtr * 
        pvaOut:IntPtr -> int 
protected function ExecCommand(
    itemid : uint, 
    pguidCmdGroup : Guid, 
    nCmdID : uint, 
    nCmdexecopt : uint, 
    pvaIn : IntPtr, 
    pvaOut : IntPtr
) : int

Parameters

  • itemid
    Type: System.UInt32
    The identifier of the item affected by the command. For single selection, this value is the actual item ID. For multiple selections, set itemid equal to [F:Microsoft.VisualStudio.VSConstants.][VSITEMID_SELECTION].
  • pguidCmdGroup
    Type: System.Guid%
    Unique identifier of the command group. All the commands in nCmdID must belong to the group specified by pguidCmdGroup.
  • nCmdID
    Type: System.UInt32
    The command to be executed. This command must belong to the group specified with pguidCmdGroup.
  • pvaIn
    Type: System.IntPtr
    A pointer to a VARIANTARG structure containing input arguments. Can be nulla null reference (Nothing in Visual Basic).
  • pvaOut
    Type: System.IntPtr
    A pointer to a VARIANTARG structure to receive command output. Can be nulla null reference (Nothing in Visual Basic).

Return Value

Type: System.Int32
If the method succeeds, it returns [F:Microsoft.VisualStudio.VSConstants.][S_OK]. If it fails, it returns an error code.

Remarks

This method calls [T:Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchyM:Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy.ExecCommand(System.UInt32,System.Guid@,System.UInt32,System.UInt32,System.IntPtr,System.IntPtr)] on the inner project.

.NET Framework Security

See Also

Reference

FlavoredProject Class

FlavoredProject Members

Microsoft.VisualStudio.Shell.Flavor Namespace