RecycleBinItemCollection 類別
指定資源回收筒項目的集合。
繼承階層架構
System.Object
Microsoft.SharePoint.Client.ClientObject
Microsoft.SharePoint.Client.ClientObjectCollection
Microsoft.SharePoint.Client.ClientObjectCollection<RecycleBinItem>
Microsoft.SharePoint.Client.RecycleBinItemCollection
命名空間: 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 RecycleBinItemCollection _
Inherits ClientObjectCollection(Of RecycleBinItem)
'用途
Dim instance As RecycleBinItemCollection
public sealed class RecycleBinItemCollection : ClientObjectCollection<RecycleBinItem>
範例
本程式碼範例顯示的標題和的第一個項目識別碼指定網站的資源回收筒]。
using System;
using Microsoft.SharePoint.Client;
namespace Microsoft.SDK.SharePointFoundation.Samples
{
class RecycleBinItemCollectionExample
{
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 中) 成員是安全執行緒。不保證任何執行個體成員都是安全執行緒。