Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
1/5/2010
Defines one enhancement to the default Shell View menu system.
Namespace: Microsoft.RemoteToolSdk.PluginComponents
Assembly: Microsoft.RemoteToolSdk (in microsoft.remotetoolsdk.dll)
Syntax
public class CommandUICommand
'Declaration
Public Class CommandUICommand
Remarks
Think of this object as a menuitem or a toolBar button. This object has similar properties and events. When defining this object, you specify where it should be "rooted".
The command enhancement will only appear if it is in the CommandUI.PluginCommands list.
See the T:Microsoft.RemoteToolSdk.PluginComponents.CommandUI section for a detailed discussion.
Inheritance Hierarchy
System.Object
Microsoft.RemoteToolSdk.PluginComponents.CommandUICommand
Example
The following code snippet shows how to create a Help...About menuitem.
CommandUICommand helpAbout =
new CommandUICommand(
CommandUI.CommandRoot.HelpMenu, // Root off the Help menu
"About My Plug-in..." // Text of our menu enhancement
);
The following code snippet shows how to create a submenu off the Action menu, with two menu items under it.
CommandUICommand subMenu =
new CommandUICommand(
CommandUI.CommandRoot.EditMenu, // Root off the Edit menu
"A submenu" // Text of our menu enhancement
);
CommandUICommand subMenuItem1 =
new CommandUICommand(
subMenu, // Root off the submenu we just created
"Menuitem 1" // Text of our menu enhancement
);
CommandUICommand subMenuItem2 =
new CommandUICommand(
subMenu, // Root off the submenu we just created
"Menuitem 2" // Text of our menu enhancement
);
The following example shows how to add a top-level menu, with two items underneath it.
CommandUICommand topLevelMenu =
new CommandUICommand(
CommandUI.CommandRoot.CustomMenu, // Custom top-level menu
"Widgets" // Text of our menu enhancement
);
CommandUICommand subMenuItem1 =
new CommandUICommand(
topLevelMenu, // Root off the menu we just created
"Menuitem 1" // Text of our menu enhancement
);
CommandUICommand subMenuItem2 =
new CommandUICommand(
topLevelMenu, // Root off the menu we just created
"Menuitem 2" // Text of our menu enhancement
);
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread-safe. Any instance members are not guaranteed to be thread-safe.
See Also
Reference
CommandUICommand Members
Microsoft.RemoteToolSdk.PluginComponents Namespace