OleMenuCommandService Class

 

This class derives from the MenuCommandService class and implements IOleCommandTarget. MenuCommandService is the managed class used to add handlers for menu commands and to define verbs.

Namespace:   Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)

System.Object
  System.ComponentModel.Design.MenuCommandService
    Microsoft.VisualStudio.Shell.OleMenuCommandService

[ComVisibleAttribute(true)]
public class OleMenuCommandService : MenuCommandService, IOleCommandTarget

NameDescription
System_CAPS_pubmethodOleMenuCommandService(IServiceProvider)

Creates a new menu command service.

System_CAPS_pubmethodOleMenuCommandService(IServiceProvider, IOleCommandTarget)

Creates a new menu command service.

NameDescription
System_CAPS_pubpropertyParentTarget

Gets or sets the parent command target.

System_CAPS_protpropertyServiceProvider

Obsolete.Gets the service provider.

System_CAPS_pubpropertyVerbs

(Inherited from MenuCommandService.)

NameDescription
System_CAPS_pubmethodAddCommand(MenuCommand)

(Inherited from MenuCommandService.)

System_CAPS_pubmethodAddVerb(DesignerVerb)

(Inherited from MenuCommandService.)

System_CAPS_pubmethodDispose()

(Inherited from MenuCommandService.)

System_CAPS_protmethodDispose(Boolean)

(Inherited from MenuCommandService.)

System_CAPS_protmethodEnsureVerbs()

(Inherited from MenuCommandService.)

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodFindCommand(CommandID)

(Inherited from MenuCommandService.)

System_CAPS_protmethodFindCommand(Guid, Int32)

(Inherited from MenuCommandService.)

System_CAPS_protmethodGetCommandList(Guid)

(Inherited from MenuCommandService.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_protmethodGetService(Type)

(Inherited from MenuCommandService.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodGlobalInvoke(CommandID)

Can be used to invoke any command within Visual Studio.(Overrides MenuCommandService.GlobalInvoke(CommandID).)

System_CAPS_pubmethodGlobalInvoke(CommandID, Object)

Can be used to invoke any command within Visual Studio.(Overrides MenuCommandService.GlobalInvoke(CommandID, Object).)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethodOnCommandsChanged(MenuCommandsChangedEventArgs)

Called by a menu command when its status has changed.(Overrides MenuCommandService.OnCommandsChanged(MenuCommandsChangedEventArgs).)

System_CAPS_pubmethodRemoveCommand(MenuCommand)

(Inherited from MenuCommandService.)

System_CAPS_pubmethodRemoveVerb(DesignerVerb)

(Inherited from MenuCommandService.)

System_CAPS_pubmethodShowContextMenu(CommandID, Int32, Int32)

Shows the shortcut menu with the given command ID at the given location.(Overrides MenuCommandService.ShowContextMenu(CommandID, Int32, Int32).)

System_CAPS_pubmethodToString()

(Inherited from Object.)

NameDescription
System_CAPS_pubeventMenuCommandsChanged

(Inherited from MenuCommandService.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIOleCommandTarget.Exec(Guid, UInt32, UInt32, IntPtr, IntPtr)

This API supports the product infrastructure and is not intended to be used directly from your code. Executes the selected command.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIOleCommandTarget.QueryStatus(Guid, UInt32, OLECMD[], IntPtr)

This API supports the product infrastructure and is not intended to be used directly from your code. Sets command status.

OleMenuCommandService is automatically offered by the Package class (to offer global commands for an entire package), and it is also offered by the WindowPane class (to offer commands for the current window). This offering is always done via the service container, so anyone deriving from the Package or WindowPane classes can remove or replace the default implementation of this class. This class uses several other services. All of these services are optional, so the class's behavior will degrade if one or more services are missing. The following table shows which services are used and for what purpose:

Service

Use

ISelectionService

Used to discover the current selection in order to obtain verbs offered by the currently selected designer.

IDesignerHost

Used to obtain the designer for the currently selected component, if any.

IVsUIShell

Used to notify Visual Studio that the command status has changed.

Used to execute global commands

OleComponentUIManager

Used to show context menus

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: