PublishingPageCollection Class

Definition

Represents a collection of PublishingPage objects.

public ref class PublishingPageCollection sealed : Microsoft::SharePoint::Publishing::QueryBasedCollection<Microsoft::SharePoint::Publishing::PublishingPage ^>
public sealed class PublishingPageCollection : Microsoft.SharePoint.Publishing.QueryBasedCollection<Microsoft.SharePoint.Publishing.PublishingPage>
type PublishingPageCollection = class
    inherit QueryBasedCollection<PublishingPage>
Public NotInheritable Class PublishingPageCollection
Inherits QueryBasedCollection(Of PublishingPage)
Inheritance

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 FoundationSPQuery 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 SPQuery instance which has an 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 SPQuery instance that has an RowLimit property.

Properties

Count

Gets the number of items in the collection.

(Inherited from CollectionBase<T>)
IsSynchronized

Gets whether the collection is synchronized.

(Inherited from CollectionBase<T>)
Item[Guid]

Gets an item by its unique identifier (ID).

(Inherited from QueryBasedCollection<T>)
Item[Int32]

Gets the item at the specified index.

(Inherited from CollectionBase<T>)
Item[String]

Gets an item by its Web-relative URL.

(Inherited from QueryBasedCollection<T>)
PubWeb

Gets the PublishingWeb object that contains this PublishingWeb object.

RowLimit

Gets the maximum number of items that can be contained in a collection that is using data paging.

(Inherited from QueryBasedCollection<T>)
SyncRoot

Gets the object that can be used to synchronize access to this collection.

(Inherited from CollectionBase<T>)

Methods

Add(String, PageLayout)

Creates a new PublishingPage in the PublishingPageCollection of the PublishingWeb object.

Add(String, SPFile, Guid, PageConversionPriority)
Obsolete.

Creates a new PublishingPage in the PublishingPageCollection of the PublishingWeb by converting a source document.

Add(String, SPFile, Guid, String, PageConversionPriority)
Obsolete.

Creates a new PublishingPage in the PublishingPageCollection of the PublishingWeb b by converting a source document according to the settings that are passed.

CopyTo(Array, Int32)

Copies the internal collection to the specified array, starting at the specified index.

(Inherited from CollectionBase<T>)
EnsureItemIsUnique(SPListItem)

Verifies whether the current item has already been retrieved.

(Inherited from QueryBasedCollection<T>)
GetEnumerator()

Returns a generic enumerator that can iterate through this generic CollectionBase instance.

(Inherited from CollectionBase<T>)
QueryNext()

Advances the collection to the next subset of paged data.

(Inherited from QueryBasedCollection<T>)

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Gets an enumerator that can iterate through the CollectionBase.

(Inherited from CollectionBase<T>)

Applies to