MenuItem class
SharePoint 2013
Used to create and modify the behavior of items on a Web Part menu.
Namespace: Microsoft.SharePoint.WebPartPages
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
The following code example shows an overridden CreateWebPartMenu that includes two custom Boolean properties, ParentItemIsVisible and EnableItem1, that allow you to control when these menu items are visible and enabled. It also assumes that this method is part of a Web Part class that includes an event handler named EventHandlerForItem1.
Show: