Partager via


OleMenuCommandService Constructor (IServiceProvider, IOleCommandTarget)

Creates a new menu command service.

Namespace:  Microsoft.VisualStudio.Shell
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

'Déclaration
Public Sub New ( _
    serviceProvider As IServiceProvider, _
    parentCommandTarget As IOleCommandTarget _
)
'Utilisation
Dim serviceProvider As IServiceProvider
Dim parentCommandTarget As IOleCommandTarget

Dim instance As New OleMenuCommandService(serviceProvider, _
    parentCommandTarget)
public OleMenuCommandService(
    IServiceProvider serviceProvider,
    IOleCommandTarget parentCommandTarget
)
public:
OleMenuCommandService(
    IServiceProvider^ serviceProvider, 
    IOleCommandTarget^ parentCommandTarget
)
new : 
        serviceProvider:IServiceProvider * 
        parentCommandTarget:IOleCommandTarget -> OleMenuCommandService
public function OleMenuCommandService(
    serviceProvider : IServiceProvider, 
    parentCommandTarget : IOleCommandTarget
)

Parameters

  • serviceProvider
    Type: System.IServiceProvider
    The service provider that this service uses to obtain other services. If the service is being used with a designer, this should be the service provider for the designer (such as the DesignSurface instance).

Exceptions

Exception Condition
ArgumentNullException

Throws an ArgumentNullException if parentCommandTarget is null.

.NET Framework Security

See Also

Reference

OleMenuCommandService Class

OleMenuCommandService Members

OleMenuCommandService Overload

Microsoft.VisualStudio.Shell Namespace