Compartilhar via


PublishingPageCollection Class

Represents a collection of PublishingPage objects.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Publishing.CollectionBase<PublishingPage>
    Microsoft.SharePoint.Publishing.QueryBasedCollection<PublishingPage>
      Microsoft.SharePoint.Publishing.PublishingPageCollection

Namespace:  Microsoft.SharePoint.Publishing
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class PublishingPageCollection _
    Inherits QueryBasedCollection(Of PublishingPage)
'Usage
Dim instance As PublishingPageCollection
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class PublishingPageCollection : QueryBasedCollection<PublishingPage>

Remarks

The collection provides an integer indexer method, foreach enumeration support (For Each in Microsoft Visual Basic), and a Count property. These can all be used to explicitly iterate over the collection.

Additionally, this collection uses Collaborative Application Markup Language (CAML) to apply sorting and filtering, and it provides base class support through the QueryBasedCollection base class.

CAML defines a query to be used in a Microsoft SharePoint FoundationMicrosoft.SharePoint.SPQuery object, which the QueryBasedCollection base class provides. The CAML query must be applied when the collection is initially created and retrieved. For example, the GetPublishingPages method includes overloads that take a CAML string directly, as well as overloads that take an Microsoft.SharePoint.SPQuery instance which has an SPQuery.Query property.

PublishingPageCollection also supports data paging, which makes it possible to retrieve subsets of the collection. The QueryBasedCollection base class provides this support. You must specify the maximum number of PublishingPage objects that can be retrieved in each subset when you initially create or retrieve the collection. For example, the PublishingWeb.GetPublishingPages method has overloads which take a row limit, as well as overloads that take an Microsoft.SharePoint.SPQuery instance that has an SPQuery.RowLimit property.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

PublishingPageCollection Members

Microsoft.SharePoint.Publishing Namespace