CSLA .NET 10.0.0
A home for your business logic
Loading...
Searching...
No Matches
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

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

Protected Member Functions

void OnListChanged (ListChangedEventArgs e)
 Raises the ListChanged event.

Properties

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

Events

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

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.
Type Constraints
T :notnull 

Member Function Documentation

◆ Add()

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

Implemented by IList source object.

Parameters
itemItem to add to the list.
Exceptions
ArgumentNullExceptionitem is null.

◆ AddIndex()

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

Implemented by IList source object.

Parameters
propertyProperty on which to build the index.
Exceptions
ArgumentNullExceptionproperty is null.

◆ AddNew()

object? Csla.SortedBindingList< T >.AddNew ( )
inline

Implemented by IList source object.

◆ ApplySort() [1/2]

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

Applies a sort to the view.

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

◆ ApplySort() [2/2]

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

Applies a sort to the view.

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

◆ Clear()

void Csla.SortedBindingList< T >.Clear ( )
inline

Implemented by IList source object.

◆ CompareTo()

int Csla.SortedBindingList< T >.CompareTo ( ListItem? other)
inline

◆ Contains()

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

Implemented by IList source object.

Parameters
itemItem for which to search.
Exceptions
ArgumentNullExceptionitem is null.

◆ CopyTo()

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

Implemented by IList source object.

Parameters
arrayArray to receive the data.
arrayIndexStarting array index.
Exceptions
ArgumentNullExceptionarray is null.

◆ Dispose()

void Csla.SortedBindingList< T >.Dispose ( )
inline

◆ Find() [1/2]

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

Implemented by IList source object.

Parameters
keyKey value for which to search.
propertyProperty to search for the key value.
Exceptions
ArgumentNullExceptionproperty or key is null.

◆ Find() [2/2]

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

Finds an item in the view.

Parameters
propertyNameName of the property to search
keyValue to find
Exceptions
ArgumentNullExceptionkey is null.
ArgumentExceptionpropertyName is null, string.Empty or only consists of white spaces.

◆ GetEnumerator()

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

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

◆ IndexOf()

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

Implemented by IList source object.

Parameters
itemItem for which to search.
Exceptions
ArgumentNullExceptionitem is null.

◆ Insert()

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

Implemented by IList source object.

Parameters
indexIndex at which to insert the item.
itemItem to insert.
Exceptions
ArgumentNullExceptionitem is null.

◆ ListItem()

Csla.SortedBindingList< T >.ListItem ( object key,
int baseIndex )
inline

◆ MoveNext()

bool Csla.SortedBindingList< T >.MoveNext ( )
inline

◆ OnListChanged()

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

Raises the ListChanged event.

Parameters
eEvent arguments.
Exceptions
ArgumentNullExceptione is null.

◆ Remove()

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

Implemented by IList source object.

Parameters
itemItem to be removed.
Exceptions
ArgumentNullExceptionitem is null.

◆ RemoveAt()

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

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.

◆ RemoveIndex()

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

Implemented by IList source object.

Parameters
propertyProperty for which the index should be removed.
Exceptions
ArgumentNullExceptionproperty is null.

◆ RemoveSort()

void Csla.SortedBindingList< T >.RemoveSort ( )
inline

Removes any sort currently applied to the view.

◆ Reset()

void Csla.SortedBindingList< T >.Reset ( )
inline

◆ SortedBindingList()

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

Creates a new view based on the provided IList object.

Parameters
listThe IList (collection) containing the data.
Exceptions
ArgumentNullExceptionlist is null.

◆ SortedEnumerator()

Csla.SortedBindingList< T >.SortedEnumerator ( IList< T > list,
List< ListItem > sortIndex,
ListSortDirection direction )
inline

◆ ToArray()

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

Get an array containing all items in the list.

◆ ToString()

override string Csla.SortedBindingList< T >.ToString ( )
inline

Property Documentation

◆ AllowEdit

bool Csla.SortedBindingList< T >.AllowEdit
get

Implemented by IList source object.

◆ AllowNew

bool Csla.SortedBindingList< T >.AllowNew
get

Implemented by IList source object.

◆ AllowRemove

bool Csla.SortedBindingList< T >.AllowRemove
get

Implemented by IList source object.

◆ BaseIndex

int Csla.SortedBindingList< T >.BaseIndex
getset

◆ Count

int Csla.SortedBindingList< T >.Count
get

Implemented by IList source object.

◆ Current

T Csla.SortedBindingList< T >.Current
get

◆ IsReadOnly

bool Csla.SortedBindingList< T >.IsReadOnly
get

Implemented by IList source object.

◆ IsSorted

bool Csla.SortedBindingList< T >.IsSorted
get

Gets a value indicating whether the view is currently sorted.

◆ Key

object Csla.SortedBindingList< T >.Key
get

◆ SortDirection

ListSortDirection Csla.SortedBindingList< T >.SortDirection = ListSortDirection.Ascending
get

Returns the direction of the current sort.

◆ SortProperty

PropertyDescriptor? Csla.SortedBindingList< T >.SortProperty
get

Returns the PropertyDescriptor of the current sort.

◆ SourceList

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

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

◆ SupportsChangeNotification

bool Csla.SortedBindingList< T >.SupportsChangeNotification
get

Returns true since this object does raise the ListChanged event.

◆ SupportsSearching

bool Csla.SortedBindingList< T >.SupportsSearching
get

Implemented by IList source object.

◆ SupportsSorting

bool Csla.SortedBindingList< T >.SupportsSorting
get

Returns true. Sorting is supported.

◆ 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.
Exceptions
ArgumentNullExceptionvalue is null.

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.


The documentation for this class was generated from the following file: