Class ItemsSourceBase
- Namespace
- Ecng.ComponentModel
- Assembly
- Ecng.ComponentModel.dll
Represents a non-generic items source based on objects.
public class ItemsSourceBase : ItemsSourceBase<object>, IItemsSource<object>, IItemsSource
- Inheritance
-
ItemsSourceBase
- Implements
- Inherited Members
- Extension Methods
Constructors
ItemsSourceBase()
public ItemsSourceBase()
Methods
Create(object, Type, bool?, ListSortDirection?, Func<IItemsSourceItem, bool>, Func<object, string>, Func<object, string>)
Creates an IItemsSource from an object.
public static IItemsSource Create(object val, Type itemValueType, bool? excludeObsolete = null, ListSortDirection? sortOrder = null, Func<IItemsSourceItem, bool> filter = null, Func<object, string> getName = null, Func<object, string> getDescription = null)
Parameters
val
objectThe source value.
itemValueType
TypeThe expected type of the items.
excludeObsolete
bool?A value indicating whether obsolete items should be excluded.
sortOrder
ListSortDirection?The sort order for the items.
filter
Func<IItemsSourceItem, bool>A filter function to apply on items.
getName
Func<object, string>A function to retrieve the display name from a value.
getDescription
Func<object, string>A function to retrieve the description from a value.
Returns
- IItemsSource
An instance of IItemsSource.