다음을 통해 공유


SPRecycleBinItemCollection.GetItemById Method

Gets the Recycle Bin item with the specified ID from the collection.

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

Syntax

'Declaration
<ClientCallableMethodAttribute(Name := "GetById", CacheReturnValue := True)> _
<ClientCallableExceptionConstraintAttribute(FixedId := "b", Condition := "No item in the Recycle Bin has the specified ID.",  _
    ErrorType := GetType(ArgumentException))> _
Public Function GetItemById ( _
    id As Guid _
) As SPRecycleBinItem
'Usage
Dim instance As SPRecycleBinItemCollection
Dim id As Guid
Dim returnValue As SPRecycleBinItem

returnValue = instance.GetItemById(id)
[ClientCallableMethodAttribute(Name = "GetById", CacheReturnValue = true)]
[ClientCallableExceptionConstraintAttribute(FixedId = "b", Condition = "No item in the Recycle Bin has the specified ID.", 
    ErrorType = typeof(ArgumentException))]
public SPRecycleBinItem GetItemById(
    Guid id
)

Parameters

  • id
    Type: System.Guid

    A System.Guid object that specifies the item to retrieve.

Return Value

Type: Microsoft.SharePoint.SPRecycleBinItem
The recycle bin item with the specified ID.

Exceptions

Exception Condition
ArgumentException

The recycle bin item with the id does not exist in the collection.

Remarks

This method gets the recycle bin item with the specified ID from the collection.

See Also

Reference

SPRecycleBinItemCollection Class

SPRecycleBinItemCollection Members

Microsoft.SharePoint Namespace