ListItemCollection 类

表示ListItem对象的集合。

继承层次结构

System.Object
  Microsoft.SharePoint.Client.ClientObject
    Microsoft.SharePoint.Client.ClientObjectCollection
      Microsoft.SharePoint.Client.ClientObjectCollection<ListItem>
        Microsoft.SharePoint.Client.ListItemCollection

命名空间:  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 Class ListItemCollection _
    Inherits ClientObjectCollection(Of ListItem)
用法
Dim instance As ListItemCollection
public class ListItemCollection : ClientObjectCollection<ListItem>

备注

要从列表中返回的项的集合,它是最佳做法使用List类的GetItems*方法之一。

返回一个列表项的集合并将其分配给ListItemCollection对象后,您可以使用索引从集合中返回单个项目。例如,假设集合分配给一个名为collListItems变量中使用collListItems[index]在 C# 或collListItems(index)在 Visual Basic 中索引所在的索引集合中的项目或列表字段的显示名称。或者,若要从列表中的项目集返回单个项目,请使用Get*List或另一个SharePoint Server对象尽可能返回特定项目或文件的方法之一。如果您使用以下方法之一,不会枚举的列表或库以返回的项目中的所有项目。例如,使用Web[Overload:Microsoft.SharePoint.Client.Web.GetFileByRelativeUrl(System.String)] 方法以返回相对的 URL,从库的网站中的特定文件,或使用ListGetItemById(Int32)方法当您知道其 GUID 检索特定项目。

线程安全性

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

另请参阅

引用

ListItemCollection 成员

Microsoft.SharePoint.Client 命名空间