Export (0) Print
Expand All

MenuCommandService Class

Implements the IMenuCommandService interface.

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

public class MenuCommandService : IMenuCommandService, 
	IDisposable

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

The 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 IMenuCommandService interface.

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

Service

Purpose

ISelectionService

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

IDesignerHost

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

Microsoft.VisualStudio.Shell.Interop.IVsUIShell

Used to notify Visual Studio that the command status has changed.

Microsoft.VisualStudio.Shell.Interop.IOleComponentUIManager

Used to show context menus.

System.Object
  System.ComponentModel.Design.MenuCommandService

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft