C# 클래스 IdeaBlade.Windows.EntityQueryPagedCollectionView

A collection providing paging, sorting, grouping and filtering of query results.
The EntityQueryPagedCollectionView can be used from code behind, and view models in MVVM architectures, to provide paged results to bound controls. It is also used internally by the ObjectDataSource when declarative specification in XAML is wanted.

The EntityQuery provided in the constructor will be executed asynchronously as needed to fulfill each paging request. Note that unless a CacheOnly query strategy is defined, the first time a page is loaded it will use a DataSourceOnly fetch strategy. Subsequent executions will use the QueryStrategy defined on the query. Note that the query must be an EntityQuery, you can't use this collection with a StoredProcQuery or PassthruEsqlQuery. For those queries, use the .NET PagedCollectionView instead.

The EntityManager of the query is used to perform query execution. If none is specified an exception is thrown. If the EntityManager is not logged in, an asynchronous login with null credentials is performed.

To use with a DataPager control, set or bind its Source property to an instance of the EntityQueryPagedCollectionView.

상속: IPagedCollectionView, ICollectionView, IEditableCollectionView, INotifyPropertyChanged
파일 보기 프로젝트 열기: IdeaBlade/DevForce.Utilities 1 사용 예제들

Private Properties

프로퍼티 타입 설명
AddCachingActions IEnumerable
BeginTrackPageLoading void
BuildFilteredQuery EntityQuery
BuildOrderedQuery EntityQuery
DoGrouping void
DoInitialLoad void
EndTrackPageLoading void
EntityQueryPagedCollectionView IdeaBlade.Core
GetLookAheadCount int
GetMemberExpression System.Linq.Expressions.Expression
GetScalarQuery IEntityScalarQuery
GetSortDescriptionList IList
GetTryRefreshPosition int
IndexToUserState string
InitFields void
InitialLoadCore IEnumerable
IsPageLoadOutstanding bool
LoadPage void
LoadPageComplete void
MakePagedQuery IEntityQuery
OnPageLoadError PageLoadErrorEventArgs
ReloadCurrentPage void
RemoveItemFromList void
SetCurrentInfo bool
SetTotalItemCount void
ShouldLoadLookAheadPage bool
UserStateToIndex int

공개 메소드들

메소드 설명
AddNew ( ) : object

Creates an item and adds it to the collection for editing.

Calls BeginEdit if the item implements IEditableObject. EntityManager.CreateEntity is used to create the item.

CancelEdit ( ) : void

Cancels editing of the CurrentEditItem.

Calls CancelEdit if the item implements IEditableObject.

CancelNew ( ) : void

Cancels editing of the CurrentAddItem.

Calls CancelEdit if the item implements IEditableObject.

ClearQueryFilter ( ) : void

Can be used to clear the filter.

After clearing the filter, call Refresh to re-query and load the view.

Calling either of the SetQueryFilter(IPredicateDescription) overloads with a null value will also clear the filter.

CommitEdit ( ) : void

Completes editing of the CurrentEditItem.

Calls EndEdit if the item implements IEditableObject.

CommitNew ( ) : void

Completes editing of the CurrentAddItem.

Calls EndEdit if the item implements IEditableObject. EntityManager.AddEntity is called to add the item to the EntityManager cache.

Contains ( object item ) : bool

Returns true if the current page contains the specified item.

DeferRefresh ( ) : IDisposable

Called by bound controls when data should be refreshed.

EditItem ( object item ) : void

Make an item the CurrentEditItem.

If the item implements IEditableObject BeginEdit is called.

EntityQueryPagedCollectionView ( EntityQuery query, int pageSize ) : IdeaBlade.Core

Create an instance of this class.

Specify the query which will be executed asynchronously to provide paged results. The "load size", the number of items loaded as each page is request, will default to twice the pageSize value.

EntityQueryPagedCollectionView ( EntityQuery query, int pageSize, int loadSize ) : IdeaBlade.Core

Creates an instance of this class.

Specify the query which will be executed asynchronously to provide paged results. Set pageSize and loadSize to control the number of items displayed and loaded during a page request. If loadSize is a multiple of pageSize then "look ahead" queries are performed to cache page results.

EntityQueryPagedCollectionView ( EntityQuery query, int pageSize, int loadSize, bool deferLoad, bool addPrimaryKeySort ) : IdeaBlade.Core

Create a new instance of this class.

Specify the query which will be executed asynchronously to provide paged results. If the first page should not be immediately loaded set deferLoad to true, and call Refresh() when ready to retrieve data.

GetEnumerator ( ) : IEnumerator

Returns the collection enumerator.

MoveCurrentTo ( object item ) : bool

Selects the indicated item as the CurrentItem.

MoveCurrentToFirst ( ) : bool

Selects the item at position 0 as the CurrentItem.

MoveCurrentToLast ( ) : bool

Selects the last item on the page as the CurrentItem.

MoveCurrentToNext ( ) : bool

Selects the next item as the CurrentItem.

MoveCurrentToPosition ( int position ) : bool

Moves the CurrentPosition to the position indicated.

MoveCurrentToPrevious ( ) : bool

Selects the previous item as the CurrentItem.

MoveToFirstPage ( ) : bool

Move to the first page in the collection.

MoveToLastPage ( ) : bool

Move to the last page in the collection.

MoveToNextPage ( ) : bool

Move to the next page in the collection.

MoveToPage ( int pageIndex ) : bool

Move to the specified 0-based page index.

MoveToPreviousPage ( ) : bool

Move to the previous page in the collection.

Refresh ( ) : void

Re-create the view, using any SortDescriptions, GroupDescriptions and/or filter.

Call Refresh if the EntityQueryPagedCollectionView was created with deferred loading.

RefreshCurrentPage ( ) : void

Reload the current page.

Remove ( object item ) : void

Removes an item from the page and calls Delete on the item.

RemoveAt ( int index ) : void

Removes the item at the specified row index and calls Delete on the item.

SetQueryFilter ( System.Linq.Expressions expression ) : void

Set a filter for this view.

After setting the filter, call Refresh to re-query and load the view.

SetQueryFilter ( IPredicateDescription predicateDescription ) : void

Set a filter for this view.

The filter can be a simple or composite predicate. See the PredicateDescription and PredicateBuilder for more information on building dynamic filter criteria.

After setting the filter, call Refresh to re-query and load the view.

보호된 메소드들

메소드 설명
OnCollectionChanged ( NotifyCollectionChangedAction action, object item, int index ) : void

Fires CollectionChanged.

OnCurrentChanged ( ) : void

Fires CurrentChanged.

OnCurrentChanging ( ) : bool

Fires CurrentChanging.

OnPageChanged ( ) : void

Fires PageChanged.

OnPageChanging ( int newPageIndex ) : bool

Fires PageChanging event.

OnPropertyChanged ( string propertyName ) : void

Fires PropertyChanged.

비공개 메소드들

메소드 설명
AddCachingActions ( int requestedPageIndex, bool includeRequestedPage ) : IEnumerable
BeginTrackPageLoading ( int pageIndex ) : void
BuildFilteredQuery ( ) : EntityQuery
BuildOrderedQuery ( ) : EntityQuery

Build a query with OrderBy, ThenBy operators.

DoGrouping ( ) : void
DoInitialLoad ( ) : void
EndTrackPageLoading ( int pageIndex ) : void
EntityQueryPagedCollectionView ( EntityQuery query, int pageSize, int loadSize, SortDescriptionCollection sortDescriptors, ObservableCollection groupDescriptors, IPredicateDescription filter ) : IdeaBlade.Core
GetLookAheadCount ( int pageSize, int loadSize ) : int
GetMemberExpression ( System.Linq.Expressions parm, string path ) : Expression
GetScalarQuery ( ) : IEntityScalarQuery

Build a scalar query from the original query.

GetSortDescriptionList ( ) : IList
GetTryRefreshPosition ( ) : int
IndexToUserState ( int index ) : string
InitFields ( ) : void
InitialLoadCore ( int beginPageIndex, bool getTotal ) : IEnumerable
IsPageLoadOutstanding ( int pageIndex ) : bool
LoadPage ( int pageIndex ) : void
LoadPageComplete ( EntityQueryOperation args ) : void
MakePagedQuery ( int requestedPageIndex ) : IEntityQuery

Build a paged query based on the current ordered query.

OnPageLoadError ( IBaseOperation op ) : PageLoadErrorEventArgs
ReloadCurrentPage ( ) : void
RemoveItemFromList ( object item, bool isNew ) : void
SetCurrentInfo ( int newPosition ) : bool
SetTotalItemCount ( int count ) : void
ShouldLoadLookAheadPage ( int pageIndex ) : bool
UserStateToIndex ( object userState ) : int

메소드 상세

AddNew() 공개 메소드

Creates an item and adds it to the collection for editing.
Calls BeginEdit if the item implements IEditableObject. EntityManager.CreateEntity is used to create the item.
public AddNew ( ) : object
리턴 object

CancelEdit() 공개 메소드

Cancels editing of the CurrentEditItem.
Calls CancelEdit if the item implements IEditableObject.
public CancelEdit ( ) : void
리턴 void

CancelNew() 공개 메소드

Cancels editing of the CurrentAddItem.
Calls CancelEdit if the item implements IEditableObject.
public CancelNew ( ) : void
리턴 void

ClearQueryFilter() 공개 메소드

Can be used to clear the filter.
After clearing the filter, call Refresh to re-query and load the view.

Calling either of the SetQueryFilter(IPredicateDescription) overloads with a null value will also clear the filter.

public ClearQueryFilter ( ) : void
리턴 void

CommitEdit() 공개 메소드

Completes editing of the CurrentEditItem.
Calls EndEdit if the item implements IEditableObject.
public CommitEdit ( ) : void
리턴 void

CommitNew() 공개 메소드

Completes editing of the CurrentAddItem.
Calls EndEdit if the item implements IEditableObject. EntityManager.AddEntity is called to add the item to the EntityManager cache.
public CommitNew ( ) : void
리턴 void

Contains() 공개 메소드

Returns true if the current page contains the specified item.
public Contains ( object item ) : bool
item object
리턴 bool

DeferRefresh() 공개 메소드

Called by bound controls when data should be refreshed.
public DeferRefresh ( ) : IDisposable
리턴 IDisposable

EditItem() 공개 메소드

Make an item the CurrentEditItem.
If the item implements IEditableObject BeginEdit is called.
public EditItem ( object item ) : void
item object
리턴 void

EntityQueryPagedCollectionView() 공개 메소드

Create an instance of this class.
Specify the query which will be executed asynchronously to provide paged results. The "load size", the number of items loaded as each page is request, will default to twice the pageSize value.
public EntityQueryPagedCollectionView ( EntityQuery query, int pageSize ) : IdeaBlade.Core
query EntityQuery The query providing the results to the collection
pageSize int The number of items to be displayed per page
리턴 IdeaBlade.Core

EntityQueryPagedCollectionView() 공개 메소드

Creates an instance of this class.
Specify the query which will be executed asynchronously to provide paged results. Set pageSize and loadSize to control the number of items displayed and loaded during a page request. If loadSize is a multiple of pageSize then "look ahead" queries are performed to cache page results.
public EntityQueryPagedCollectionView ( EntityQuery query, int pageSize, int loadSize ) : IdeaBlade.Core
query EntityQuery The query providing the results to the collection
pageSize int The number of items to be displayed per page
loadSize int The number of items to be loaded when a page is requested
리턴 IdeaBlade.Core

EntityQueryPagedCollectionView() 공개 메소드

Create a new instance of this class.
Specify the query which will be executed asynchronously to provide paged results. If the first page should not be immediately loaded set deferLoad to true, and call Refresh() when ready to retrieve data.
public EntityQueryPagedCollectionView ( EntityQuery query, int pageSize, int loadSize, bool deferLoad, bool addPrimaryKeySort ) : IdeaBlade.Core
query EntityQuery The query providing the results to the collection
pageSize int The number of items to be displayed per page
loadSize int The number of items to be loaded when a page is requested
deferLoad bool Whether to defer load
addPrimaryKeySort bool Whether the data should be sorted on primary key
리턴 IdeaBlade.Core

GetEnumerator() 공개 메소드

Returns the collection enumerator.
public GetEnumerator ( ) : IEnumerator
리턴 IEnumerator

MoveCurrentTo() 공개 메소드

Selects the indicated item as the CurrentItem.
public MoveCurrentTo ( object item ) : bool
item object
리턴 bool

MoveCurrentToFirst() 공개 메소드

Selects the item at position 0 as the CurrentItem.
public MoveCurrentToFirst ( ) : bool
리턴 bool

MoveCurrentToLast() 공개 메소드

Selects the last item on the page as the CurrentItem.
public MoveCurrentToLast ( ) : bool
리턴 bool

MoveCurrentToNext() 공개 메소드

Selects the next item as the CurrentItem.
public MoveCurrentToNext ( ) : bool
리턴 bool

MoveCurrentToPosition() 공개 메소드

Moves the CurrentPosition to the position indicated.
public MoveCurrentToPosition ( int position ) : bool
position int
리턴 bool

MoveCurrentToPrevious() 공개 메소드

Selects the previous item as the CurrentItem.
public MoveCurrentToPrevious ( ) : bool
리턴 bool

MoveToFirstPage() 공개 메소드

Move to the first page in the collection.
public MoveToFirstPage ( ) : bool
리턴 bool

MoveToLastPage() 공개 메소드

Move to the last page in the collection.
public MoveToLastPage ( ) : bool
리턴 bool

MoveToNextPage() 공개 메소드

Move to the next page in the collection.
public MoveToNextPage ( ) : bool
리턴 bool

MoveToPage() 공개 메소드

Move to the specified 0-based page index.
public MoveToPage ( int pageIndex ) : bool
pageIndex int
리턴 bool

MoveToPreviousPage() 공개 메소드

Move to the previous page in the collection.
public MoveToPreviousPage ( ) : bool
리턴 bool

OnCollectionChanged() 보호된 메소드

Fires CollectionChanged.
protected OnCollectionChanged ( NotifyCollectionChangedAction action, object item, int index ) : void
action NotifyCollectionChangedAction
item object
index int
리턴 void

OnCurrentChanged() 보호된 메소드

Fires CurrentChanged.
protected OnCurrentChanged ( ) : void
리턴 void

OnCurrentChanging() 보호된 메소드

Fires CurrentChanging.
protected OnCurrentChanging ( ) : bool
리턴 bool

OnPageChanged() 보호된 메소드

Fires PageChanged.
protected OnPageChanged ( ) : void
리턴 void

OnPageChanging() 보호된 메소드

Fires PageChanging event.
protected OnPageChanging ( int newPageIndex ) : bool
newPageIndex int
리턴 bool

OnPropertyChanged() 보호된 메소드

Fires PropertyChanged.
protected OnPropertyChanged ( string propertyName ) : void
propertyName string
리턴 void

Refresh() 공개 메소드

Re-create the view, using any SortDescriptions, GroupDescriptions and/or filter.
Call Refresh if the EntityQueryPagedCollectionView was created with deferred loading.
public Refresh ( ) : void
리턴 void

RefreshCurrentPage() 공개 메소드

Reload the current page.
public RefreshCurrentPage ( ) : void
리턴 void

Remove() 공개 메소드

Removes an item from the page and calls Delete on the item.
public Remove ( object item ) : void
item object
리턴 void

RemoveAt() 공개 메소드

Removes the item at the specified row index and calls Delete on the item.
public RemoveAt ( int index ) : void
index int
리턴 void

SetQueryFilter() 공개 메소드

Set a filter for this view.
After setting the filter, call Refresh to re-query and load the view.
public SetQueryFilter ( System.Linq.Expressions expression ) : void
expression System.Linq.Expressions
리턴 void

SetQueryFilter() 공개 메소드

Set a filter for this view.
The filter can be a simple or composite predicate. See the PredicateDescription and PredicateBuilder for more information on building dynamic filter criteria.

After setting the filter, call Refresh to re-query and load the view.

public SetQueryFilter ( IPredicateDescription predicateDescription ) : void
predicateDescription IPredicateDescription
리턴 void