Lists all versions for a page. Default base class implementation has no versioning support so it uses GetLanguageBranches(PageReference) to get language pages. If versioning is to be supported this method should be overriden.

Namespace:  EPiServer.Core
Assembly:  EPiServer (in EPiServer.dll) Version: 5.2.375.236

Syntax

C#
public virtual PageVersionCollection ListVersions(
	PageReference pageLink
)

Parameters

pageLink
Type: EPiServer.Core..::.PageReference
The page link.

Return Value

Implements

IPageStore..::.ListVersions(PageReference)

Examples

The following code sample is an implementation of ListVersions() for XmlPageProvider.
CopyC#
public override PageVersionCollection ListVersions(PageReference pageLink)
{
    PageVersionCollection collection = new PageVersionCollection();
    PageVersion pageVersion;
    var pages = from page in XmlPages.Elements("pages").Elements<XElement>("page")
                where int.Parse(page.Attribute("id").Value) == pageLink.ID
                select page;
    foreach (XElement page in pages)
    {
        pageVersion = new PageVersion(ConstructPageReference(pageLink.ID, int.Parse(page.Attribute("versionid").Value)),
                                      GetPropertyValue("PageName", page),
                                      (VersionStatus)int.Parse(GetPropertyValue("PageWorkStatus", page)),
                                      DateTime.Parse(GetPropertyValue("PageChanged", page) == null ? GetPropertyValue("PageCreated", page) : GetPropertyValue("PageChanged", page)),
                                      "",
                                      "",
                                      0,
                                      GetPropertyValue("PageLanguageBranch",page),
                                      String.Equals(GetPropertyValue("PageLanguageBranch",page),GetPropertyValue("PageMasterLanguageBranch",page))
                                      );
        collection.Add(pageVersion);
    }
    return collection;
}

See Also