OleMenuCommand Class
Represents a menu command in Visual Studio.
Assembly: Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)
| Name | Description | |
|---|---|---|
![]() | OleMenuCommand(EventHandler, CommandID) | Initializes a new instance of OleMenuCommand for the specified command. |
![]() | OleMenuCommand(EventHandler, CommandID, String) | Initializes a new instance of OleMenuCommand for the specified command. |
![]() | 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) | Initializes a new instance of OleMenuCommand for the specified command with the specified invocation and status handlers. |
![]() | 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) | Initializes a new instance of OleMenuCommand for the specified command with the specified pre-QueryStatus, invocation, and status handlers. |
| Name | Description | |
|---|---|---|
![]() | Checked | (Inherited from MenuCommand.) |
![]() | CommandID | (Inherited from MenuCommand.) |
![]() | Enabled | (Inherited from MenuCommand.) |
![]() | MatchedCommandId | Gets or sets the command ID. |
![]() | OleStatus | Gets the OLE command status code for this menu item.(Overrides MenuCommand.OleStatus.) |
![]() | ParametersDescription | Gets or sets the description of the parameters of the command. |
![]() | Properties | (Inherited from MenuCommand.) |
![]() | Supported | (Inherited from MenuCommand.) |
![]() | Text | Gets or sets the text for the command. |
![]() | Visible | (Inherited from MenuCommand.) |
| Name | Description | |
|---|---|---|
![]() | DynamicItemMatch(Int32) | Allows a dynamic item command to match the subsequent items in its list. |
![]() | Equals(Object) | (Inherited from Object.) |
![]() | Finalize() | (Inherited from Object.) |
![]() | GetHashCode() | (Inherited from Object.) |
![]() | GetType() | (Inherited from Object.) |
![]() | Invoke() | (Inherited from MenuCommand.) |
![]() | Invoke(Object) | Executes the command.(Overrides MenuCommand.Invoke(Object).) |
![]() | Invoke(Object, IntPtr) | Executes the command. |
![]() | Invoke(Object, IntPtr, OLECMDEXECOPT) | Executes the command with the specified parameters and execution options. |
![]() | MemberwiseClone() | (Inherited from Object.) |
![]() | OnCommandChanged(EventArgs) | (Inherited from MenuCommand.) |
![]() | ToString() | (Inherited from MenuCommand.) |
| Name | Description | |
|---|---|---|
![]() | BeforeQueryStatus | Called when a client requests the status of the command. |
![]() | CommandChanged | (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:
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.



