SPUserResourceCollection.Add Method (String, String, SPResourceType)

Creates a user resource and adds it to the collection.

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

Syntax

'Declaration
Public Sub Add ( _
    resourceName As String, _
    resourceValue As String, _
    type As SPResourceType _
)
'Usage
Dim instance As SPUserResourceCollection
Dim resourceName As String
Dim resourceValue As String
Dim type As SPResourceType

instance.Add(resourceName, resourceValue, _
    type)
public void Add(
    string resourceName,
    string resourceValue,
    SPResourceType type
)

Parameters

  • resourceName
    Type: System.String

    A string that specifies the name for the user resource. The name must begin with an alphanumeric character and cannot be null .

  • resourceValue
    Type: System.String

    A string that specifies the value of the resource for the culture of the current thread.

Exceptions

Exception Condition
ArgumentNullException

resourceName is null or empty.

ArgumentException

The value of the resourceName parameter does not start with an alphanumeric character.

Remarks

The method creates a new SPUserResource object that contains the parameters and adds it to the collection using the Add(SPUserResource) method.

See Also

Reference

SPUserResourceCollection Class

SPUserResourceCollection Members

Add Overload

Microsoft.SharePoint Namespace

Name