Initializes a new instance of the CommandContextBoundMenuCommand class.
Namespace: Microsoft.VisualStudio.Modeling.Shell
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Shell (in Microsoft.VisualStudio.Modeling.Sdk.Shell.dll)
Syntax
'宣言
Public Sub New ( _
serviceProvider As IServiceProvider, _
handler As EventHandler, _
id As CommandID, _
ParamArray commandContext As Guid() _
)
'使用
Dim serviceProvider As IServiceProvider
Dim handler As EventHandler
Dim id As CommandID
Dim commandContext As Guid()
Dim instance As New CommandContextBoundMenuCommand(serviceProvider, _
handler, id, commandContext)
public CommandContextBoundMenuCommand(
IServiceProvider serviceProvider,
EventHandler handler,
CommandID id,
params Guid[] commandContext
)
public:
CommandContextBoundMenuCommand(
IServiceProvider^ serviceProvider,
EventHandler^ handler,
CommandID^ id,
... array<Guid>^ commandContext
)
public function CommandContextBoundMenuCommand(
serviceProvider : IServiceProvider,
handler : EventHandler,
id : CommandID,
... commandContext : Guid[]
)
Parameters
serviceProvider
Type: System.IServiceProviderThe service provider that retrieves Visual Studio services.
handler
Type: System.EventHandlerThe event handler that executes the command.
id
Type: System.ComponentModel.Design.CommandIDThe command ID that is assigned to the menu command.
commandContext
Type: []The GUID(s) that indicate the command context to which this command is assigned.
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.
See Also
Reference
CommandContextBoundMenuCommand Class