ListItemCollectionPosition-Klasse
Gibt die erforderlichen Informationen zum Abrufen der nächsten Seite mit Daten für eine Listenansicht an.
Vererbungshierarchie
System.Object
Microsoft.SharePoint.Client.ClientValueObject
Microsoft.SharePoint.Client.ListItemCollectionPosition
Namespace: Microsoft.SharePoint.Client
Assemblys: Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll); Microsoft.SharePoint.Client.Phone (in Microsoft.SharePoint.Client.Phone.dll) Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)
Syntax
'Declaration
Public Class ListItemCollectionPosition _
Inherits ClientValueObject
'Usage
Dim instance As ListItemCollectionPosition
public class ListItemCollectionPosition : ClientValueObject
Beispiele
In diesem Codebeispiel zeigt Titel, zwei nacheinander, aus der Liste der Ankündigungen auf der angegebenen Website.
using System;
using Microsoft.SharePoint.Client;
namespace Microsoft.SDK.SharePointFoundation.Samples
{
class ListItemCollectionPositionExample
{
static void Main()
{
string siteUrl = "http://MyServer/sites/MySiteCollection";
ClientContext clientContext = new ClientContext(siteUrl);
Web site = clientContext.Web;
List targetList = site.Lists.GetByTitle("Announcements");
CamlQuery query = new CamlQuery();
query.ViewXml = "<View><ViewFields><FieldRef Name='Title'/></ViewFields><RowLimit>2</RowLimit></View>";
ListItemCollection collListItem = targetList.GetItems(query);
clientContext.Load(collListItem);
clientContext.ExecuteQuery();
string msg = "Titles, two at a time:\n";
foreach (ListItem myListItem in collListItem)
msg += "\nTitle=" + myListItem["Title"];
Console.WriteLine(msg);
ListItemCollectionPosition position = collListItem.ListItemCollectionPosition;
do
{
msg = "";
query.ListItemCollectionPosition = position;
collListItem = targetList.GetItems(query);
clientContext.Load(collListItem);
clientContext.ExecuteQuery();
position = collListItem.ListItemCollectionPosition;
foreach (ListItem myListItem in collListItem)
msg += "\nTitle=" + myListItem["Title"];
Console.WriteLine(msg);
} while (position != null);
}
}
}
Threadsicherheit
Alle öffentlichen static (Shared in Visual Basic) Member dieses Typs sind threadsicher. Die Threadsicherheit von Instanzmembern ist nicht gewährleistet.