OleMenuCommand Class

 

Represents a menu command in Visual Studio.

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

System.Object
  System.ComponentModel.Design.MenuCommand
    Microsoft.VisualStudio.Shell.OleMenuCommand

[ComVisibleAttribute(true)]
public class OleMenuCommand : MenuCommand, IOleMenuCommand, IMenuCommandInvokeEx

NameDescription
System_CAPS_pubmethodOleMenuCommand(EventHandler, CommandID)

Initializes a new instance of OleMenuCommand for the specified command.

System_CAPS_pubmethodOleMenuCommand(EventHandler, CommandID, String)

Initializes a new instance of OleMenuCommand for the specified command.

System_CAPS_pubmethodOleMenuCommand(EventHandler, EventHandler, CommandID)

Initializes a new instance of OleMenuCommand for the specified command with the specified invocation and status handlers.

System_CAPS_pubmethodOleMenuCommand(EventHandler, EventHandler, CommandID, String)

Initializes a new instance of OleMenuCommand for the specified command with the specified invocation and status handlers.

System_CAPS_pubmethodOleMenuCommand(EventHandler, EventHandler, EventHandler, CommandID)

Initializes a new instance of OleMenuCommand for the specified command with the specified pre-QueryStatus, invocation, and status handlers.

System_CAPS_pubmethodOleMenuCommand(EventHandler, EventHandler, EventHandler, CommandID, String)

Initializes a new instance of OleMenuCommand for the specified command with the specified pre-QueryStatus, invocation, and status handlers.

NameDescription
System_CAPS_pubpropertyChecked

(Inherited from MenuCommand.)

System_CAPS_pubpropertyCommandID

(Inherited from MenuCommand.)

System_CAPS_pubpropertyEnabled

(Inherited from MenuCommand.)

System_CAPS_pubpropertyMatchedCommandId

Gets or sets the command ID.

System_CAPS_pubpropertyOleStatus

Gets the OLE command status code for this menu item.(Overrides MenuCommand.OleStatus.)

System_CAPS_pubpropertyParametersDescription

Gets or sets the description of the parameters of the command.

System_CAPS_pubpropertyProperties

(Inherited from MenuCommand.)

System_CAPS_pubpropertySupported

(Inherited from MenuCommand.)

System_CAPS_pubpropertyText

Gets or sets the text for the command.

System_CAPS_pubpropertyVisible

(Inherited from MenuCommand.)

NameDescription
System_CAPS_pubmethodDynamicItemMatch(Int32)

Allows a dynamic item command to match the subsequent items in its list.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodInvoke()

(Inherited from MenuCommand.)

System_CAPS_pubmethodInvoke(Object)

Executes the command.(Overrides MenuCommand.Invoke(Object).)

System_CAPS_pubmethodInvoke(Object, IntPtr)

Executes the command.

System_CAPS_pubmethodInvoke(Object, IntPtr, OLECMDEXECOPT)

Executes the command with the specified parameters and execution options.

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethodOnCommandChanged(EventArgs)

(Inherited from MenuCommand.)

System_CAPS_pubmethodToString()

(Inherited from MenuCommand.)

NameDescription
System_CAPS_pubeventBeforeQueryStatus

Called when a client requests the status of the command.

System_CAPS_pubeventCommandChanged

(Inherited from MenuCommand.)

This class implements IOleMenuCommand and T:Microsoft.VisualStudio.Shell.IOleCommandInvokeEx, and derives from MenuCommand. You can use either MenuCommand or OleMenuCommand when you add a command in a Visual Studio extension. However, if the command is added dynamically, it makes more sense to use OleMenuCommand, in order to implement the BeforeQueryStatus handler.

You can find examples of this class in the following walkthroughs:

  1. MenuCommands Vs. OleMenuCommands

  2. Changing the Text of a Menu Command

  3. How to: Create Menus, SubMenus, and Shortcut 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: