RecycleBinItem 类

Represents a Recycle Bin item in the Recycle Bin of a site or a site collection.

继承层次结构

System.Object
  Microsoft.SharePoint.Client.ClientObject
    Microsoft.SharePoint.Client.RecycleBinItem

命名空间:  Microsoft.SharePoint.Client
程序集:   Microsoft.SharePoint.Client.Silverlight(位于 Microsoft.SharePoint.Client.Silverlight.dll 中);  Microsoft.SharePoint.Client.Phone(位于 Microsoft.SharePoint.Client.Phone.dll 中)  Microsoft.SharePoint.Client(位于 Microsoft.SharePoint.Client.dll 中)

语法

声明
Public NotInheritable Class RecycleBinItem _
    Inherits ClientObject
用法
Dim instance As RecycleBinItem
public sealed class RecycleBinItem : ClientObject

示例

This code example displays the title and identifier of the first item in the Recycle Bin of the specified site.

using System;
using Microsoft.SharePoint.Client;

namespace Microsoft.SDK.SharePointFoundation.Samples
{
    class RecycleBinItemExample
    {
        static void Main()
        {
            string siteUrl = "http://MyServer/sites/MySiteCollection";

            ClientContext clientContext = new ClientContext(siteUrl);
            Site collSite = clientContext.Site;
            RecycleBinItemCollection collRBI = collSite.RecycleBin;

            clientContext.Load(collRBI);
            clientContext.ExecuteQuery();

            if (collRBI.Count > 0)
            {
               RecycleBinItem rbiItem = collRBI[0];
               Console.WriteLine("Title: {0}", rbiItem.Title);
               Console.WriteLine("Item ID: {0}", rbiItem.Id);
            }
            else
            {
               Console.WriteLine("The Recycle Bin is empty.");
            }
        }
    }
}

线程安全性

该类型的任何公共 静态 (已共享 在 Visual Basic 中) 成员都是线程安全的。不保证任何实例成员都是线程安全的。

另请参阅

引用

RecycleBinItem 成员

Microsoft.SharePoint.Client 命名空间