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

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

Inheritance diagram for Csla.FilteredBindingList< T >:

Public Member Functions

IEnumerator< T > GetEnumerator ()
 Gets an enumerator object. More...
 
void AddIndex (PropertyDescriptor property)
 Implemented by IList source object. More...
 
object AddNew ()
 Implemented by IList source object. More...
 
void ApplySort (PropertyDescriptor property, ListSortDirection direction)
 Sorts the list if the original list supports sorting. More...
 
void ApplySort (string propertyName, ListSortDirection direction)
 Sorts the list if the original list supports sorting. 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)
 Copies the contents of the list to an array. More...
 
void Add (T item)
 Adds an item to the list. More...
 
void Clear ()
 Clears the list. More...
 
bool Contains (T item)
 Determines whether the specified item is contained in the list. More...
 
int IndexOf (T item)
 Gets the 0-based index of an item in the list. More...
 
void Insert (int index, T item)
 Inserts an item into the list. More...
 
bool Remove (T item)
 Removes an item from the list. More...
 
void RemoveAt (int index)
 Removes an item from the list. More...
 
 FilteredBindingList (IList< T > list)
 Creates a new view based on the provided IList object. More...
 
 FilteredBindingList (IList< T > list, FilterProvider filterProvider)
 Creates a new view based on the provided IList object. More...
 
void ApplyFilter ()
 Applies a filter to the view using the most recently used property name and filter provider. More...
 
void ApplyFilter (string propertyName, object filter)
 Applies a filter to the view. More...
 
void ApplyFilter (PropertyDescriptor property, object filter)
 Applies a filter to the view. More...
 
void RemoveFilter ()
 Removes the filter from the list, so the view reflects the state of the original list. 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]
 Returns True if 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]
 Gets the number of items in the list. More...
 
bool IsReadOnly [get]
 Gets a value indicating whether the list is read-only. More...
 
this[int index] [getset]
 Gets or sets the item at the specified index. More...
 
IList< T > SourceList [get]
 Gets the source list over which this SortedBindingList is a view. More...
 
FilterProvider FilterProvider [getset]
 Gets or sets the filter provider method. More...
 
PropertyDescriptor FilterProperty [get]
 The property on which the items will be filtered. More...
 
bool IsFiltered [get]
 Returns True if the view is currently filtered. More...
 

Events

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

Detailed Description

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

Template Parameters
TThe type of the objects contained in the original list.

Definition at line 21 of file FilteredBindingList.cs.

Constructor & Destructor Documentation

◆ FilteredBindingList() [1/2]

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

Creates a new view based on the provided IList object.

Parameters
listThe IList (collection) containing the data.

Definition at line 747 of file FilteredBindingList.cs.

◆ FilteredBindingList() [2/2]

Csla.FilteredBindingList< T >.FilteredBindingList ( IList< T >  list,
FilterProvider  filterProvider 
)

Creates a new view based on the provided IList object.

Parameters
listThe IList (collection) containing the data.
filterProviderDelegate pointer to a method that implements the filter behavior.

Definition at line 767 of file FilteredBindingList.cs.

Member Function Documentation

◆ Add()

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

Adds an item to the list.

Parameters
itemItem to be added.

Definition at line 553 of file FilteredBindingList.cs.

◆ AddIndex()

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

Implemented by IList source object.

Parameters
propertyProperty on which to build the index.

Definition at line 211 of file FilteredBindingList.cs.

◆ AddNew()

object Csla.FilteredBindingList< T >.AddNew ( )

Implemented by IList source object.

Definition at line 220 of file FilteredBindingList.cs.

◆ ApplyFilter() [1/3]

void Csla.FilteredBindingList< T >.ApplyFilter ( )

Applies a filter to the view using the most recently used property name and filter provider.

Definition at line 822 of file FilteredBindingList.cs.

◆ ApplyFilter() [2/3]

void Csla.FilteredBindingList< T >.ApplyFilter ( PropertyDescriptor  property,
object  filter 
)

Applies a filter to the view.

Parameters
propertyA PropertyDescriptor for the property on which to filter.
filterThe filter criteria.

Definition at line 862 of file FilteredBindingList.cs.

◆ ApplyFilter() [3/3]

void Csla.FilteredBindingList< T >.ApplyFilter ( string  propertyName,
object  filter 
)

Applies a filter to the view.

Parameters
propertyNameThe text name of the property on which to filter.
filterThe filter criteria.

Definition at line 834 of file FilteredBindingList.cs.

◆ ApplySort() [1/2]

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

Sorts the list if the original list supports sorting.

Parameters
propertyProperty on which to sort.
directionDirection of the sort.

Definition at line 280 of file FilteredBindingList.cs.

◆ ApplySort() [2/2]

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

Sorts the list if the original list supports sorting.

Parameters
propertyNamePropertyName on which to sort.
directionDirection of the sort.

Definition at line 295 of file FilteredBindingList.cs.

◆ Clear()

void Csla.FilteredBindingList< T >.Clear ( )

Clears the list.

Definition at line 571 of file FilteredBindingList.cs.

◆ Contains()

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

Determines whether the specified item is contained in the list.

Parameters
itemItem to find.
Returns
true if the item is contained in the list.

Definition at line 587 of file FilteredBindingList.cs.

◆ CopyTo()

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

Copies the contents of the list to an array.

Parameters
arrayArray to receive the data.
arrayIndexStarting array index.

Definition at line 503 of file FilteredBindingList.cs.

◆ Find() [1/2]

int Csla.FilteredBindingList< 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 367 of file FilteredBindingList.cs.

◆ Find() [2/2]

int Csla.FilteredBindingList< 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 340 of file FilteredBindingList.cs.

◆ GetEnumerator()

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

Gets an enumerator object.

Returns

Definition at line 194 of file FilteredBindingList.cs.

◆ IndexOf()

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

Gets the 0-based index of an item in the list.

Parameters
itemThe item to find.
Returns
0-based index of the item in the list.

Definition at line 604 of file FilteredBindingList.cs.

◆ Insert()

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

Inserts an item into the list.

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

Definition at line 620 of file FilteredBindingList.cs.

◆ OnListChanged()

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

Raises the ListChanged event.

Parameters
eParameter for the event.

Definition at line 404 of file FilteredBindingList.cs.

◆ Remove()

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

Removes an item from the list.

Parameters
itemItem to remove.
Returns
true if the remove succeeds.

Definition at line 662 of file FilteredBindingList.cs.

◆ RemoveAt()

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

Removes an item from the list.

Parameters
indexIndex of item to be removed.

Definition at line 677 of file FilteredBindingList.cs.

◆ RemoveFilter()

void Csla.FilteredBindingList< T >.RemoveFilter ( )

Removes the filter from the list, so the view reflects the state of the original list.

Definition at line 875 of file FilteredBindingList.cs.

◆ RemoveIndex()

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

Implemented by IList source object.

Parameters
propertyProperty for which the index should be removed.

Definition at line 415 of file FilteredBindingList.cs.

◆ RemoveSort()

void Csla.FilteredBindingList< T >.RemoveSort ( )

Removes any sort currently applied to the view.

Definition at line 424 of file FilteredBindingList.cs.

◆ ToArray()

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

Get an array containing all items in the list.

Definition at line 1032 of file FilteredBindingList.cs.

Property Documentation

◆ AllowEdit

bool Csla.FilteredBindingList< T >.AllowEdit
get

Implemented by IList source object.

Definition at line 235 of file FilteredBindingList.cs.

◆ AllowNew

bool Csla.FilteredBindingList< T >.AllowNew
get

Implemented by IList source object.

Definition at line 249 of file FilteredBindingList.cs.

◆ AllowRemove

bool Csla.FilteredBindingList< T >.AllowRemove
get

Implemented by IList source object.

Definition at line 263 of file FilteredBindingList.cs.

◆ Count

int Csla.FilteredBindingList< T >.Count
get

Gets the number of items in the list.

Definition at line 523 of file FilteredBindingList.cs.

◆ FilterProperty

PropertyDescriptor Csla.FilteredBindingList< T >.FilterProperty
get

The property on which the items will be filtered.

A descriptor for the property on which the items in the collection will be filtered.

Returns

Definition at line 804 of file FilteredBindingList.cs.

◆ FilterProvider

FilterProvider Csla.FilteredBindingList< T >.FilterProvider
getset

Gets or sets the filter provider method.

Delegate pointer to a method that implements the filter behavior.

Returns
Delegate pointer to a method that implements the filter behavior.

If this value is set to Nothing (null in C#) then the default filter provider, DefaultFilter will be used.

Definition at line 785 of file FilteredBindingList.cs.

◆ IsFiltered

bool Csla.FilteredBindingList< T >.IsFiltered
get

Returns True if the view is currently filtered.

Definition at line 812 of file FilteredBindingList.cs.

◆ IsReadOnly

bool Csla.FilteredBindingList< T >.IsReadOnly
get

Gets a value indicating whether the list is read-only.

Definition at line 639 of file FilteredBindingList.cs.

◆ IsSorted

bool Csla.FilteredBindingList< T >.IsSorted
get

Returns True if the view is currently sorted.

Definition at line 378 of file FilteredBindingList.cs.

◆ SortDirection

ListSortDirection Csla.FilteredBindingList< T >.SortDirection
get

Returns the direction of the current sort.

Definition at line 435 of file FilteredBindingList.cs.

◆ SortProperty

PropertyDescriptor Csla.FilteredBindingList< T >.SortProperty
get

Returns the PropertyDescriptor of the current sort.

Definition at line 449 of file FilteredBindingList.cs.

◆ SourceList

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

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

Definition at line 723 of file FilteredBindingList.cs.

◆ SupportsChangeNotification

bool Csla.FilteredBindingList< T >.SupportsChangeNotification
get

Returns True since this object does raise the ListChanged event.

Definition at line 464 of file FilteredBindingList.cs.

◆ SupportsSearching

bool Csla.FilteredBindingList< T >.SupportsSearching
get

Implemented by IList source object.

Definition at line 472 of file FilteredBindingList.cs.

◆ SupportsSorting

bool Csla.FilteredBindingList< T >.SupportsSorting
get

Returns True.

Sorting is supported.

Definition at line 486 of file FilteredBindingList.cs.

◆ this[int index]

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

Gets or sets the item at the specified index.

Parameters
indexIndex of the item.
Returns
Item at the specified index.

Definition at line 693 of file FilteredBindingList.cs.

Event Documentation

◆ ListChanged

ListChangedEventHandler Csla.FilteredBindingList< 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 filter is changed to indicate that the view's data has changed.

Definition at line 398 of file FilteredBindingList.cs.