共用方式為


OleMenuCommandService.GlobalInvoke Method (CommandID)

Can be used to invoke any command within Visual Studio.

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

'宣告
Public Overrides Function GlobalInvoke ( _
    commandID As CommandID _
) As Boolean
'用途
Dim instance As OleMenuCommandService
Dim commandID As CommandID
Dim returnValue As Boolean

returnValue = instance.GlobalInvoke(commandID)
public override bool GlobalInvoke(
    CommandID commandID
)
public:
virtual bool GlobalInvoke(
    CommandID^ commandID
) override
abstract GlobalInvoke : 
        commandID:CommandID -> bool 
override GlobalInvoke : 
        commandID:CommandID -> bool 
public override function GlobalInvoke(
    commandID : CommandID
) : boolean

Parameters

Return Value

Type: System.Boolean
true if the invocation succeeded; otherwise, false.

Implements

IMenuCommandService.GlobalInvoke(CommandID)

Remarks

The GlobalInvoke method can be used to invoke any command within Visual Studio. Visual Studio uses a built-in search hierarchy to search for the requested command. The search pattern favors the current document window and then moves out to broader focus.

.NET Framework Security

See Also

Reference

OleMenuCommandService Class

OleMenuCommandService Members

GlobalInvoke Overload

Microsoft.VisualStudio.Shell Namespace