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
valobjectThe source value.
itemValueTypeTypeThe expected type of the items.
excludeObsoletebool?A value indicating whether obsolete items should be excluded.
sortOrderListSortDirection?The sort order for the items.
filterFunc<IItemsSourceItem, bool>A filter function to apply on items.
getNameFunc<object, string>A function to retrieve the display name from a value.
getDescriptionFunc<object, string>A function to retrieve the description from a value.
Returns
- IItemsSource
An instance of IItemsSource.