SPRoleCollection.Item Property (Int32)
NOTE: This API is now obsolete.
Obsolete. Use the new SPRoleDefinition and SPRoleAssignment classes instead, to define roles and to assign users to them. For more information, see Authorization Object Model. (In Windows SharePoint Services 2.0, the Item property returned the role object at the specified index in the collection and is maintained for backward compatibility.)
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
<ObsoleteAttribute("Use the SPRoleDefinitionCollection class instead")> _
Public ReadOnly Property Item ( _
index As Integer _
) As SPRole
Get
'Usage
Dim instance As SPRoleCollection
Dim index As Integer
Dim value As SPRole
value = instance.Item(index)
[ObsoleteAttribute("Use the SPRoleDefinitionCollection class instead")]
public SPRole this[
int index
] { get; }
Parameters
index
Type: System.Int32A 32-bit integer that specifies the index.
Property Value
Type: Microsoft.SharePoint.SPRole
An SPRole object that represents the role.
Remarks
The Item property throws an ArgumentOutOfRangeException if the specified index is outside the valid range of indexes for the collection.