DataFactoryBase Class
Provides an abstract base class for an IDataFactory implementation.
public abstract class DataFactoryBase : IDataFactory
- Inheritance:
- object object
- Derived:
- TypeDescriptorFactory
- Implements:
- IDataFactory
Constructors
DataFactoryBase()
Initializes an instance of the class.
protected DataFactoryBase()
Methods
AutoConfigurePropertyModel(PropertyModel, IDataFactoryRequest)
Auto-configures the specified PropertyModel by examining a Binding
on its Value,
locating the related property information, and filling in many of the other PropertyModel properties that have default values.
protected virtual void AutoConfigurePropertyModel(PropertyModel propertyModel, IDataFactoryRequest request)
Parameter | Type | Description |
---|---|---|
propertyModel | PropertyModel | The PropertyModel to update. |
request | IDataFactoryRequest | An IDataFactoryRequest that contains data about the request. |
CategorizeDataModels(IList<IDataModel>, IDataFactoryRequest)
Returns a categorized variation of the specified data models collection.
protected virtual IList<IDataModel> CategorizeDataModels(IList<IDataModel> models, IDataFactoryRequest request)
Parameter | Type | Description |
---|---|---|
models | IList<IDataModel> | The collection of data models to sort. |
request | IDataFactoryRequest | An IDataFactoryRequest that contains data about the request. |
Returns
- IList<IDataModel>:
A categorized variation of the specified data models collection.
CreateCategoryEditorModel(CategoryEditor, IDataFactoryRequest)
Creates an ICategoryEditorModel for the specified CategoryEditor.
protected virtual ICategoryEditorModel CreateCategoryEditorModel(CategoryEditor categoryEditor, IDataFactoryRequest request)
Parameter | Type | Description |
---|---|---|
categoryEditor | CategoryEditor | The CategoryEditor that was used to create the data model. |
request | IDataFactoryRequest | An IDataFactoryRequest that contains data about the request. |
Returns
- ICategoryEditorModel:
The ICategoryEditorModel that was created.
CreateCategoryModel(string, IDataFactoryRequest)
Creates an ICategoryModel for the specified category name.
protected virtual ICategoryModel CreateCategoryModel(string name, IDataFactoryRequest request)
Parameter | Type | Description |
---|---|---|
name | string | The category name. |
request | IDataFactoryRequest | An IDataFactoryRequest that contains data about the request. |
Returns
- ICategoryModel:
The ICategoryModel that was created.
CreateMergedPropertyModel(IList<IPropertyModel>, IDataFactoryRequest)
Creates an IPropertyModel that merges a common property from multiple data objects.
protected virtual IPropertyModel CreateMergedPropertyModel(IList<IPropertyModel> propertyModels, IDataFactoryRequest request)
Parameter | Type | Description |
---|---|---|
propertyModels | IList<IPropertyModel> | The collection of IPropertyModel objects to merge. |
request | IDataFactoryRequest | An IDataFactoryRequest that contains data about the request. |
Returns
- IPropertyModel:
The IPropertyModel that was created.
GetDataModels(IDataFactoryRequest)
Returns the IDataModel collection for the requested object values.
public virtual IList<IDataModel> GetDataModels(IDataFactoryRequest request)
Parameter | Type | Description |
---|---|---|
request | IDataFactoryRequest | An IDataFactoryRequest that contains data about the request. |
Returns
- IList<IDataModel>:
A collection of IDataModel objects, if any were returned.
GetPropertyModels(object, IDataFactoryRequest)
Returns the IPropertyModel collection for the specified data object.
protected abstract IList<IPropertyModel> GetPropertyModels(object dataObject, IDataFactoryRequest request)
Parameter | Type | Description |
---|---|---|
dataObject | object | The single object to examine. |
request | IDataFactoryRequest | An IDataFactoryRequest that contains data about the request. |
Returns
- IList<IPropertyModel>:
A collection of IPropertyModel objects, if the specified data object has any properties.
SortDataModels(IList<IDataModel>, IDataFactoryRequest, DataModelSortComparer)
Returns a sorted variation of the specified data models collection.
protected virtual IList<IDataModel> SortDataModels(IList<IDataModel> models, IDataFactoryRequest request, DataModelSortComparer sortComparer)
Parameter | Type | Description |
---|---|---|
models | IList<IDataModel> | The collection of data models to sort. |
request | IDataFactoryRequest | An IDataFactoryRequest that contains data about the request. |
sortComparer | DataModelSortComparer | The DataModelSortComparer to use. Otherwise, fall back to the request's sort comparer. |
Returns
- IList<IDataModel>:
A sorted variation of the specified data models collection.