OleMenuCommandService Constructor (IServiceProvider, IOleCommandTarget)
Creates a new menu command service.
Namespace: Microsoft.VisualStudio.Shell
Assembly: Microsoft.VisualStudio.Shell.11.0 (in Microsoft.VisualStudio.Shell.11.0.dll)
Syntax
'Declaration
Public Sub New ( _
serviceProvider As IServiceProvider, _
parentCommandTarget As IOleCommandTarget _
)
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.IServiceProviderThe 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).
parentCommandTarget
Type: Microsoft.VisualStudio.OLE.Interop.IOleCommandTargetAllows the service to defer command searching to a parent IOleCommandTarget if the command is not found in this object.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Throws an ArgumentNullException if parentCommandTarget is null. |
.NET Framework Security
- 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.