Table of Contents

Class XPCursor

Namespace
DevExpress.Xpo
Assembly
DevExpress.Xpo.v24.1.dll

A pageable collection of persistent objects.

public class XPCursor : ICollection, IEnumerable
Inheritance
XPCursor
Implements
Inherited Members

Constructors

XPCursor(Session, XPClassInfo)

Initializes a new instance of the XPCursor class with the specified XPCursor.Session and XPCollection.ObjectClassInfo properties.

public XPCursor(Session session, XPClassInfo objType)

Parameters

session Session

A Session object which represents the session that will be used to load and save persistent objects. This value is assigned to the XPCursor.Session property.

objType XPClassInfo

An XPClassInfo object which provides the persistent class’s metadata information for the objects to include in the collection. This value is assigned to the XPCursor.ObjectClassInfo property.

XPCursor(Session, XPClassInfo, CriteriaOperator)

Initializes a new instance of the XPCursor class

public XPCursor(Session session, XPClassInfo objType, CriteriaOperator theCriteria)

Parameters

session Session

A Session object which represents the session that will be used to load and save persistent objects. This value is assigned to the XPCursor.Session property.

objType XPClassInfo

An XPClassInfo object that provides the persistent class’s metadata information for the objects to include in the collection. This value is assigned to the XPCursor.ObjectClassInfo property.

theCriteria CriteriaOperator

A DevExpress.Data.Filtering.CriteriaOperator object that specifies the filter criteria.

XPCursor(Session, XPClassInfo, CriteriaOperator, params SortProperty[])

Initializes a new instance of the XPCursor class with the specified Session and criteria-specific options.

public XPCursor(Session session, XPClassInfo objType, CriteriaOperator theCriteria, params SortProperty[] sortProperties)

Parameters

session Session

A Session object which represents the session that will be used to load and save persistent objects. This value is assigned to the XPCursor.Session property.

objType XPClassInfo

An XPClassInfo object that provides the persistent class’s metadata information for the objects to include in the collection. This value is assigned to the XPCursor.ObjectClassInfo property.

theCriteria CriteriaOperator

A DevExpress.Data.Filtering.CriteriaOperator object that specifies the filter criteria.

sortProperties SortProperty[]

An array of DevExpress.Xpo.SortProperty objects that specify the page able collection’s sort order. These objects are added to the XPCursor.Sorting collection.

XPCursor(Session, XPClassInfo, IList)

Initializes a new instance of the XPCursor class and populates it with the objects whose Oid property’s value is contained within the keyList.

public XPCursor(Session session, XPClassInfo objType, IList keysList)

Parameters

session Session

A Session object which represents the session that will be used to load and save persistent objects. This value is assigned to the XPCursor.Session property.

objType XPClassInfo

An XPClassInfo object that provides the persistent class’s metadata information for the objects to include in the collection. This value is assigned to the XPCursor.ObjectClassInfo property.

keysList IList

The list of keys that identify persistent objects to retrieve.

XPCursor(Session, Type)

Initializes a new instance of the XPCursor class.

public XPCursor(Session session, Type objType)

Parameters

session Session

A Session object which represents the session that will be used to load and save persistent objects. This value is assigned to the XPCursor.Session property.

objType Type

The type of persistent objects to include in the collection.

XPCursor(Session, Type, CriteriaOperator, params SortProperty[])

Initializes a new instance of the XPCursor class with the specified settings.

public XPCursor(Session session, Type objType, CriteriaOperator theCriteria, params SortProperty[] sortProperties)

Parameters

session Session

A Session object which represents the session that will be used to load and save persistent objects. This value is assigned to the XPCursor.Session property.

objType Type

The type of persistent objects to include in the collection.

theCriteria CriteriaOperator

A DevExpress.Data.Filtering.CriteriaOperator object that specifies the filter criteria.

sortProperties SortProperty[]

An array of DevExpress.Xpo.SortProperty objects that specify the page able collection’s sort order. These objects are added to the XPCursor.Sorting collection.

XPCursor(Session, Type, IList)

Initializes a new instance of the XPCursor class and populates it with the objects whose Oid property’s value is contained within the keyList.

public XPCursor(Session session, Type objType, IList keysList)

Parameters

session Session

A Session object which represents the session that will be used to load and save persistent objects. This value is assigned to the XPCursor.Session property.

objType Type

The type of persistent objects to include in the collection.

keysList IList

The list of unique keys that identify persistent objects to retrieve.

XPCursor(Type)

Initializes a new instance of the XPCursor class with the default Session.

public XPCursor(Type objType)

Parameters

objType Type

The type of persistent objects to include in the collection.

XPCursor(Type, CriteriaOperator, params SortProperty[])

Initializes a new instance of the XPCursor class with default Session and criteria-specific options.

public XPCursor(Type objType, CriteriaOperator theCriteria, params SortProperty[] sortProperties)

Parameters

objType Type

The type of persistent objects to include into the collection.

theCriteria CriteriaOperator

A DevExpress.Data.Filtering.CriteriaOperator object that specifies the filter criteria.

sortProperties SortProperty[]

An array of DevExpress.Xpo.SortProperty objects that specify the page able collection’s sort order. These objects are added to the XPCursor.Sorting collection.

Properties

Count

Gets the number of persistent objects within the collection.

public int Count { get; }

Property Value

int

An integer value which specifies the number of persistent objects within the collection.

ObjectClassInfo

Gets the metadata information for the persistent objects retrieved by the collection.

public XPClassInfo ObjectClassInfo { get; }

Property Value

XPClassInfo

An XPClassInfo object which provides the metadata information for the objects within the collection.

PageSize

Gets or sets the maximum number of persistent objects that can be contained in a single page.

public int PageSize { get; set; }

Property Value

int

An integer value which specifies the maximum number of persistent objects that can be contained in a single page. If less than or equal to 0, an ArgumentOutOfRangeException is raised.

SelectDeleted

Gets or sets whether deleted objects are retrieved by the XPCursor the next time it is reloaded.

public bool SelectDeleted { get; set; }

Property Value

bool

true to load deleted objects to the collection the next time it’s reloaded; otherwise, false

Session

Gets the session which is used to load and save persistent objects.

public Session Session { get; }

Property Value

Session

A Session object which represents the session that is used to load and save persistent objects.

Sorting

Provides access to the collection whose elements identify the sorted columns in a data store.

public SortingCollection Sorting { get; }

Property Value

SortingCollection

A SortingCollection object which contains information on the sorted columns in a data store.

TopReturnedObjects

Gets or sets the maximum number of objects retrieved by the XPCursor collection.

public int TopReturnedObjects { get; set; }

Property Value

int

An integer value which specifies the maximum number of objects retrieved by the collection. A 0 value indicates that all objects which match the criteria and sort order will be retrieved.

Methods

Clear()

protected void Clear()

CopyTo(Array, int)

Copies all persistent objects which are stored within the current collection to the specified array starting at the specified index.

public void CopyTo(Array array, int index)

Parameters

array Array

An array which the persistent objects are copied to.

index int

An integer value which specifies the zero-based index at which copying begins.

GetEnumerator()

Returns an IEnumerator for the collection.

public IEnumerator GetEnumerator()

Returns

IEnumerator

An object which implements the IEnumerator interface.

Load()

protected void Load()