RecycleBinItem 類別
表示網站或網站集合的資源回收筒中出現的資源回收筒項目。
繼承階層架構
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
範例
本程式碼範例顯示的標題和的第一個項目識別碼指定網站的資源回收筒]。
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.");
}
}
}
}
執行緒安全
這類型的任何公用 static (共用 於 Visual Basic 中) 成員是安全執行緒。不保證任何執行個體成員都是安全執行緒。