Condividi tramite


SPUserCustomActionCollection.Add Method

Adds a new user custom action object to the collection.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
<ClientCallableMethodAttribute(AddReturnValueToCollection := True)> _
<ClientCallableExceptionConstraintAttribute(Condition := "User does not have permissions to add a new user custom action.",  _
    ErrorType := GetType(UnauthorizedAccessException), FixedId := "accessdenied")> _
Public Function Add As SPUserCustomAction
'Usage
Dim instance As SPUserCustomActionCollection
Dim returnValue As SPUserCustomAction

returnValue = instance.Add()
[ClientCallableMethodAttribute(AddReturnValueToCollection = true)]
[ClientCallableExceptionConstraintAttribute(Condition = "User does not have permissions to add a new user custom action.", 
    ErrorType = typeof(UnauthorizedAccessException), FixedId = "accessdenied")]
public SPUserCustomAction Add()

Return Value

Type: Microsoft.SharePoint.SPUserCustomAction
SPUserCustomAction
The new custom action object.

Remarks

You must call Update() to save the new object.

See Also

Reference

SPUserCustomActionCollection Class

SPUserCustomActionCollection Members

Microsoft.SharePoint Namespace