System.Design 2.0.0.0 System.Object System.ComponentModel.Design.IMenuCommandService System.IDisposable

The class implements the interface, which is the managed interface used to add handlers for menu commands and to define verbs.

The class is automatically offered by the package class to offer global commands for an entire package, and it is also offered by the Microsoft.VisualStudio.Shell.WindowPane class to offer commands for the current window. This offering is always done through the service container, so anyone deriving from the package or window pane classes can remove or replace the default implementation of the interface.

The class utilizes several other services. All of these services are optional, so the behavior of the class degrades if one or more services are missing. The following table shows which services are used and for what purpose.

Service

Purpose

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

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

Microsoft.VisualStudio.Shell.Interop.IVsUIShell

Used to notify vsprvs that the command status has changed.

Microsoft.VisualStudio.Shell.Interop.IOleComponentUIManager

Used to show context menus.

Implements the interface.

- Constructor
  2.0.0.0

  If the service is being used with a designer, the parameter should be the service provider for the designer, as is the case with .

  Initializes a new instance of the class.

  The service provider that this service uses to obtain other services.
- Method
  2.0.0.0
  System.Void ``

  The method adds a command handler to the menu command service. Command handlers do not define the text, shortcut, or placement of a menu item. Rather, they define the menu item’s behavior if the item is clicked.

  Adds a command handler to the menu command service.

  The to add.
- Method
  2.0.0.0
  System.Void ``

  This verb is available regardless of what designer is currently selected. Unlike menu commands, verbs can define the text that is displayed to the user, but they do not define the placement of the command on the actual menu.

  Adds a verb to the verb table of the .

  The to add.
- Method
  2.0.0.0
  System.Void

  Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.

  Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's Finalize method.

  Releases all resources used by the .

- Method
  2.0.0.0
  System.Void ``

  This method is called by the public Dispose() method and the method. Dispose() invokes the protected Dispose(Boolean) method with the parameter set to true. invokes Dispose with set to false.

  When the parameter is true, this method releases all resources held by any managed objects that this references. This method invokes the Dispose() method of each referenced object.

  Releases all resources used by the .

  true to release both managed and unmanaged resources; false to release only unmanaged resources.
- Method
  2.0.0.0
  System.Void

  The method creates the verb list if it has not already been created.

  Ensures that the verb list has been created.

- Method
  2.0.0.0
  System.ComponentModel.Design.MenuCommand `` To be added.

  Searches for the associated with the given command ID.

  The associated with the given command; otherwise, null if the command is not found.

  The to find.
- Method
  2.0.0.0
  System.ComponentModel.Design.MenuCommand `` `` To be added.

  Searches for the associated with the given command.

  The associated with the given command; otherwise, null if the command is not found.

  The GUID of the command. The ID of the command.
- Method
  2.0.0.0
  System.Collections.ICollection `` To be added.

  Gets the command list for a given GUID.

  An of commands.

  The GUID of the command list.
- Method
  2.0.0.0
  System.Object `` To be added.

  Gets a reference to the requested service.

  A reference to ; otherwise, null if the service is not found.

  The of the service to retrieve.
- Method
  2.0.0.0
  System.Boolean ``

  The local form is first searched for the given command ID. If it is found, it is invoked. Otherwise, the command ID is passed to the global environment command handler, if one is available.

  Invokes the given command on the local form or in the global environment.

  true, if the command was found; otherwise, false.

  The command to invoke.
- Method
  2.0.0.0
  System.Boolean `` `` To be added.

  The local form is first searched for the given command ID. If it is found, it is invoked. Otherwise, the command ID is passed to the global environment command handler, if one is available.

  Invokes the given command with the given parameter on the local form or in the global environment.

  true, if the command was found; otherwise, false.

  A parameter for the invocation.
- Event
  2.0.0.0
  System.ComponentModel.Design.MenuCommandsChangedEventHandler

  For more information about handling events, see Consuming Events.

  Occurs when the status of a menu command has changed.

- Method
  2.0.0.0
  System.Void ``

  The method is called by a menu command when its status has changed.

  Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.

  The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

  Raises the event.

  A that contains the event data.
- Method
  2.0.0.0
  System.Void ``

  If there are no more commands in the command group, the group is removed.

  Removes the given menu command from the document.

  The command to remove.
- Method
  2.0.0.0
  System.Void `` To be added.

  Removes the given verb from the document.

  The verb to remove.
- Method
  2.0.0.0
  System.Void `` `` ``

  The default implementation does nothing.

  Shows the shortcut menu with the given command ID at the given location.

  The shortcut menu to display. The x-coordinate of the shortcut menu's location. The y-coordinate of the shortcut menu's location.
- Property
  2.0.0.0
  System.ComponentModel.Design.DesignerVerbCollection To be added.

  The property provides a collection of verbs. These verbs come from two places:

  Verbs added through the method of .

  Verbs offered by the currently selected designer.

  Verbs added to this service through the method are called global verbs because they are global to this service, but generally there is one instance of this service for each tool or document window. Designer verbs are obtained by querying the service provider for and . If the selection service offers a primary selection, and a designer can be obtained for that selection from , the designer’s verbs are added to this list. If the name of a global verb conflicts with the name of a designer verb, the designer-provided designer verb takes precedence.

  Gets a collection of the designer verbs that are currently available.