IMenuItemCollection.Add Method

Definition

Overloads

Add(String)

Creates and adds a new menu item instance with the specified text.

Add(String, Int32)

Creates and adds a new menu item instance with the specified text and sort order.

Add(String)

Creates and adds a new menu item instance with the specified text.

public:
 Microsoft::VisualStudio::SharePoint::IMenuItem ^ Add(System::String ^ text);
public Microsoft.VisualStudio.SharePoint.IMenuItem Add (string text);
abstract member Add : string -> Microsoft.VisualStudio.SharePoint.IMenuItem
Public Function Add (text As String) As IMenuItem

Parameters

text
String

The text for the menu item shown in the context menu.

Returns

An object representing the menu item added to the collection.

Applies to

Add(String, Int32)

Creates and adds a new menu item instance with the specified text and sort order.

public:
 Microsoft::VisualStudio::SharePoint::IMenuItem ^ Add(System::String ^ text, int sortOrder);
public Microsoft.VisualStudio.SharePoint.IMenuItem Add (string text, int sortOrder);
abstract member Add : string * int -> Microsoft.VisualStudio.SharePoint.IMenuItem
Public Function Add (text As String, sortOrder As Integer) As IMenuItem

Parameters

text
String

The text for the menu item displayed in the context menu.

sortOrder
Int32

A number specifying sort order of the menu item. Default value is 0. To insert the item before the default sort order, specify a negative number. To insert the item after the default sort order, specify a positive number.

Returns

An object representing the menu item added to the collection.

Applies to