System.ComponentModel.Design.MenuCommandService Class

Implements the System.ComponentModel.Design.IMenuCommandService interface.

See Also: MenuCommandService Members


public class MenuCommandService : IMenuCommandService, IDisposable


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

The System.ComponentModel.Design.MenuCommandService 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 System.ComponentModel.Design.IMenuCommandService interface.

The System.ComponentModel.Design.MenuCommandService class utilizes several other services. All of these services are optional, so the behavior of the System.ComponentModel.Design.MenuCommandService class degrades if one or more services are missing. The following table shows which services are used and for what 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.


Used to notify vsprvs that the command status has changed.


Used to show context menus.


Namespace: System.ComponentModel.Design
Assembly: System.Design (in System.Design.dll)
Assembly Versions: