OleMenuCommand OleMenuCommand OleMenuCommand OleMenuCommand Class

Definition

This class is an expansion of MenuCommand.

public ref class OleMenuCommand : System::ComponentModel::Design::MenuCommand, Microsoft::VisualStudio::Shell::IMenuCommandInvokeEx, Microsoft::VisualStudio::Shell::IOleMenuCommand
[System.Runtime.InteropServices.ComVisible(true)]
public class OleMenuCommand : System.ComponentModel.Design.MenuCommand, Microsoft.VisualStudio.Shell.IMenuCommandInvokeEx, Microsoft.VisualStudio.Shell.IOleMenuCommand
type OleMenuCommand = class
    inherit MenuCommand
    interface IOleMenuCommand
    interface IMenuCommandInvokeEx
Public Class OleMenuCommand
Inherits MenuCommand
Implements IMenuCommandInvokeEx, IOleMenuCommand
Inheritance
OleMenuCommandOleMenuCommandOleMenuCommandOleMenuCommand
Attributes
Implements

Remarks

This class implements IOleMenuCommand and <xref: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

Constructors

OleMenuCommand(EventHandler, CommandID) OleMenuCommand(EventHandler, CommandID) OleMenuCommand(EventHandler, CommandID) OleMenuCommand(EventHandler, CommandID)

Builds a new OleMenuCommand.

OleMenuCommand(EventHandler, CommandID, String) OleMenuCommand(EventHandler, CommandID, String) OleMenuCommand(EventHandler, CommandID, String) OleMenuCommand(EventHandler, CommandID, String)

Builds a new OleMenuCommand.

OleMenuCommand(EventHandler, EventHandler, CommandID) OleMenuCommand(EventHandler, EventHandler, CommandID) OleMenuCommand(EventHandler, EventHandler, CommandID) OleMenuCommand(EventHandler, EventHandler, CommandID)

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

OleMenuCommand(EventHandler, EventHandler, CommandID, String) OleMenuCommand(EventHandler, EventHandler, CommandID, String) OleMenuCommand(EventHandler, EventHandler, CommandID, String) OleMenuCommand(EventHandler, EventHandler, CommandID, String)

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

OleMenuCommand(EventHandler, EventHandler, EventHandler, CommandID) OleMenuCommand(EventHandler, EventHandler, EventHandler, CommandID) OleMenuCommand(EventHandler, EventHandler, EventHandler, CommandID) OleMenuCommand(EventHandler, EventHandler, EventHandler, CommandID)

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

OleMenuCommand(EventHandler, EventHandler, EventHandler, CommandID, String) OleMenuCommand(EventHandler, EventHandler, EventHandler, CommandID, String) OleMenuCommand(EventHandler, EventHandler, EventHandler, CommandID, String) OleMenuCommand(EventHandler, EventHandler, EventHandler, CommandID, String)

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

Properties

MatchedCommandId MatchedCommandId MatchedCommandId MatchedCommandId

Gets or sets the command ID.

OleStatus OleStatus OleStatus OleStatus

Gets the OLE command status code for this menu item.

ParametersDescription ParametersDescription ParametersDescription ParametersDescription

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

Text Text Text Text

Gets or sets the text for the command.

Methods

DynamicItemMatch(Int32) DynamicItemMatch(Int32) DynamicItemMatch(Int32) DynamicItemMatch(Int32)

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

Invoke(Object) Invoke(Object) Invoke(Object) Invoke(Object)

Executes the command.

Invoke(Object, IntPtr) Invoke(Object, IntPtr) Invoke(Object, IntPtr) Invoke(Object, IntPtr)

Executes the command.

Invoke(Object, IntPtr, OLECMDEXECOPT) Invoke(Object, IntPtr, OLECMDEXECOPT) Invoke(Object, IntPtr, OLECMDEXECOPT) Invoke(Object, IntPtr, OLECMDEXECOPT)

Executes the command with execution options.

Events

BeforeQueryStatus BeforeQueryStatus BeforeQueryStatus BeforeQueryStatus

Called when a client requests the status of the command.

Applies to