Nearly all NShape Controller- and Presenter Components support context menus. The content of the context menu is created dynamically by collecting MenuItemDef objects from all objects that can be the target of a command, e.g. the diagram, the selected shapes and their respective model objects.
You can control the offered context menu items from the command targets (shapes, model objects, diagrams) themselves or from the user interface components.
a)By changing the permissions of the users and the security domain of the shapes, context menu items can be disabled/eliminated.
See Programmer Tasks: Controlling User Access for details on how to restrict user permissions.
b)By hiding or showing menu items that cannot be executed due to missing permissions.
See "Hiding Unauthorized Menu Items".
c)By extending built-in context menus with additional global items.
See "Extending Built-In Context Menus".
d)By extending custom context menus with NShape commands.
See "Integrate NShape Commands in your Own Context Menus".
e)By modifying the shape implementation or by deriving your own shapes you can modify the GetMenuItemDefs functions and return other menu item definitions.
See "Developing a New Shape: Define Shape Specific Commands".
1.From IDiagramPresenter.ActiveTool.GetMenuItemDefs, if exactly one shape is selected:
a.From (selected) shape's Shape.Template.GetMenuItemDefs
b.From (selected) shape's Shape.GetMenuItemDefs
c.From (selected) shape's Shape.ModelObject.GetMenuItemDefs