CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
Csla.SortedBindingList< T > Class Template Reference

Provides a sorted view into an existing IList(Of T). More...

Inheritance diagram for Csla.SortedBindingList< T >:

Public Member Functions

IEnumerator< T > GetEnumerator ()
 Returns an enumerator for the list, honoring any sort that is active at the time. More...
 
void AddIndex (PropertyDescriptor property)
 Implemented by IList source object. More...
 
object AddNew ()
 Implemented by IList source object. More...
 
void ApplySort (string propertyName, ListSortDirection direction)
 Applies a sort to the view. More...
 
void ApplySort (PropertyDescriptor property, ListSortDirection direction)
 Applies a sort to the view. More...
 
int Find (string propertyName, object key)
 Finds an item in the view More...
 
int Find (PropertyDescriptor property, object key)
 Implemented by IList source object. More...
 
void RemoveIndex (PropertyDescriptor property)
 Implemented by IList source object. More...
 
void RemoveSort ()
 Removes any sort currently applied to the view. More...
 
void CopyTo (T[] array, int arrayIndex)
 Implemented by IList source object. More...
 
void Add (T item)
 Implemented by IList source object. More...
 
void Clear ()
 Implemented by IList source object. More...
 
bool Contains (T item)
 Implemented by IList source object. More...
 
int IndexOf (T item)
 Implemented by IList source object. More...
 
void Insert (int index, T item)
 Implemented by IList source object. More...
 
bool Remove (T item)
 Implemented by IList source object. More...
 
void RemoveAt (int index)
 Removes the child object at the specified index in the list, resorting the display as needed. More...
 
 SortedBindingList (IList< T > list)
 Creates a new view based on the provided IList object. More...
 
T[] ToArray ()
 Get an array containing all items in the list. More...
 

Protected Member Functions

void OnListChanged (ListChangedEventArgs e)
 Raises the ListChanged event. More...
 

Properties

bool AllowEdit [get]
 Implemented by IList source object. More...
 
bool AllowNew [get]
 Implemented by IList source object. More...
 
bool AllowRemove [get]
 Implemented by IList source object. More...
 
bool IsSorted [get]
 Gets a value indicating whether the view is currently sorted. More...
 
ListSortDirection SortDirection [get]
 Returns the direction of the current sort. More...
 
PropertyDescriptor SortProperty [get]
 Returns the PropertyDescriptor of the current sort. More...
 
bool SupportsChangeNotification [get]
 Returns true since this object does raise the ListChanged event. More...
 
bool SupportsSearching [get]
 Implemented by IList source object. More...
 
bool SupportsSorting [get]
 Returns true. More...
 
int Count [get]
 Implemented by IList source object. More...
 
bool IsReadOnly [get]
 Implemented by IList source object. More...
 
this[int index] [getset]
 Gets the child item at the specified index in the list, honoring the sort order of the items. More...
 
IList< T > SourceList [get]
 Gets the source list over which this SortedBindingList is a view. More...
 

Events

ListChangedEventHandler ListChanged
 Raised to indicate that the list's data has changed. More...
 

Detailed Description

Provides a sorted view into an existing IList(Of T).

Template Parameters
TType of child object contained by the original list or collection.

Definition at line 25 of file SortedBindingList.cs.

Constructor & Destructor Documentation

◆ SortedBindingList()

Csla.SortedBindingList< T >.SortedBindingList ( IList< T >  list)

Creates a new view based on the provided IList object.

Parameters
listThe IList (collection) containing the data.

Definition at line 736 of file SortedBindingList.cs.

Member Function Documentation

◆ Add()

void Csla.SortedBindingList< T >.Add ( item)

Implemented by IList source object.

Parameters
itemItem to add to the list.

Definition at line 551 of file SortedBindingList.cs.

◆ AddIndex()

void Csla.SortedBindingList< T >.AddIndex ( PropertyDescriptor  property)

Implemented by IList source object.

Parameters
propertyProperty on which to build the index.

Definition at line 258 of file SortedBindingList.cs.

◆ AddNew()

object Csla.SortedBindingList< T >.AddNew ( )

Implemented by IList source object.

Definition at line 267 of file SortedBindingList.cs.

◆ ApplySort() [1/2]

void Csla.SortedBindingList< T >.ApplySort ( PropertyDescriptor  property,
ListSortDirection  direction 
)

Applies a sort to the view.

Parameters
propertyA PropertyDescriptor for the property on which to sort.
directionThe direction to sort the data.

Definition at line 344 of file SortedBindingList.cs.

◆ ApplySort() [2/2]

void Csla.SortedBindingList< T >.ApplySort ( string  propertyName,
ListSortDirection  direction 
)

Applies a sort to the view.

Parameters
propertyNameThe text name of the property on which to sort.
directionThe direction to sort the data.

Definition at line 332 of file SortedBindingList.cs.

◆ Clear()

void Csla.SortedBindingList< T >.Clear ( )

Implemented by IList source object.

Definition at line 565 of file SortedBindingList.cs.

◆ Contains()

bool Csla.SortedBindingList< T >.Contains ( item)

Implemented by IList source object.

Parameters
itemItem for which to search.

Definition at line 574 of file SortedBindingList.cs.

◆ CopyTo()

void Csla.SortedBindingList< T >.CopyTo ( T[]  array,
int  arrayIndex 
)

Implemented by IList source object.

Parameters
arrayArray to receive the data.
arrayIndexStarting array index.

Definition at line 507 of file SortedBindingList.cs.

◆ Find() [1/2]

int Csla.SortedBindingList< T >.Find ( PropertyDescriptor  property,
object  key 
)

Implemented by IList source object.

Parameters
keyKey value for which to search.
propertyProperty to search for the key value.

Definition at line 395 of file SortedBindingList.cs.

◆ Find() [2/2]

int Csla.SortedBindingList< T >.Find ( string  propertyName,
object  key 
)

Finds an item in the view

Parameters
propertyNameName of the property to search
keyValue to find

Definition at line 357 of file SortedBindingList.cs.

◆ GetEnumerator()

IEnumerator< T > Csla.SortedBindingList< T >.GetEnumerator ( )

Returns an enumerator for the list, honoring any sort that is active at the time.

Definition at line 241 of file SortedBindingList.cs.

◆ IndexOf()

int Csla.SortedBindingList< T >.IndexOf ( item)

Implemented by IList source object.

Parameters
itemItem for which to search.

Definition at line 588 of file SortedBindingList.cs.

◆ Insert()

void Csla.SortedBindingList< T >.Insert ( int  index,
item 
)

Implemented by IList source object.

Parameters
indexIndex at which to insert the item.
itemItem to insert.

Definition at line 604 of file SortedBindingList.cs.

◆ OnListChanged()

void Csla.SortedBindingList< T >.OnListChanged ( ListChangedEventArgs  e)
protected

Raises the ListChanged event.

Parameters
eEvent arguments.

Definition at line 430 of file SortedBindingList.cs.

◆ Remove()

bool Csla.SortedBindingList< T >.Remove ( item)

Implemented by IList source object.

Parameters
itemItem to be removed.

Definition at line 643 of file SortedBindingList.cs.

◆ RemoveAt()

void Csla.SortedBindingList< T >.RemoveAt ( int  index)

Removes the child object at the specified index in the list, resorting the display as needed.

Parameters
indexThe index of the object to remove.

See Chapter 5 for details on how and why the list is altered during the remove process.

Definition at line 662 of file SortedBindingList.cs.

◆ RemoveIndex()

void Csla.SortedBindingList< T >.RemoveIndex ( PropertyDescriptor  property)

Implemented by IList source object.

Parameters
propertyProperty for which the index should be removed.

Definition at line 441 of file SortedBindingList.cs.

◆ RemoveSort()

void Csla.SortedBindingList< T >.RemoveSort ( )

Removes any sort currently applied to the view.

Definition at line 450 of file SortedBindingList.cs.

◆ ToArray()

T[] Csla.SortedBindingList< T >.ToArray ( )

Get an array containing all items in the list.

Definition at line 909 of file SortedBindingList.cs.

Property Documentation

◆ AllowEdit

bool Csla.SortedBindingList< T >.AllowEdit
get

Implemented by IList source object.

Definition at line 288 of file SortedBindingList.cs.

◆ AllowNew

bool Csla.SortedBindingList< T >.AllowNew
get

Implemented by IList source object.

Definition at line 302 of file SortedBindingList.cs.

◆ AllowRemove

bool Csla.SortedBindingList< T >.AllowRemove
get

Implemented by IList source object.

Definition at line 316 of file SortedBindingList.cs.

◆ Count

int Csla.SortedBindingList< T >.Count
get

Implemented by IList source object.

Definition at line 527 of file SortedBindingList.cs.

◆ IsReadOnly

bool Csla.SortedBindingList< T >.IsReadOnly
get

Implemented by IList source object.

Definition at line 622 of file SortedBindingList.cs.

◆ IsSorted

bool Csla.SortedBindingList< T >.IsSorted
get

Gets a value indicating whether the view is currently sorted.

Definition at line 409 of file SortedBindingList.cs.

◆ SortDirection

ListSortDirection Csla.SortedBindingList< T >.SortDirection
get

Returns the direction of the current sort.

Definition at line 458 of file SortedBindingList.cs.

◆ SortProperty

PropertyDescriptor Csla.SortedBindingList< T >.SortProperty
get

Returns the PropertyDescriptor of the current sort.

Definition at line 466 of file SortedBindingList.cs.

◆ SourceList

IList<T> Csla.SortedBindingList< T >.SourceList
get

Gets the source list over which this SortedBindingList is a view.

Definition at line 710 of file SortedBindingList.cs.

◆ SupportsChangeNotification

bool Csla.SortedBindingList< T >.SupportsChangeNotification
get

Returns true since this object does raise the ListChanged event.

Definition at line 475 of file SortedBindingList.cs.

◆ SupportsSearching

bool Csla.SortedBindingList< T >.SupportsSearching
get

Implemented by IList source object.

Definition at line 483 of file SortedBindingList.cs.

◆ SupportsSorting

bool Csla.SortedBindingList< T >.SupportsSorting
get

Returns true.

Sorting is supported.

Definition at line 497 of file SortedBindingList.cs.

◆ this[int index]

T Csla.SortedBindingList< T >.this[int index]
getset

Gets the child item at the specified index in the list, honoring the sort order of the items.

Parameters
indexThe index of the item in the sorted list.

Definition at line 683 of file SortedBindingList.cs.

Event Documentation

◆ ListChanged

ListChangedEventHandler Csla.SortedBindingList< T >.ListChanged

Raised to indicate that the list's data has changed.

This event is raised if the underling IList object's data changes (assuming the underling IList also implements the IBindingList interface). It is also raised if the sort property or direction is changed to indicate that the view's data has changed. See Chapter 5 for details.

Definition at line 424 of file SortedBindingList.cs.