In This Article

TypeDescriptorFactory Class

Implements an IDataFactory that uses type descriptors to return data models.

public class TypeDescriptorFactory : DataFactoryBase, IDataFactory
Inheritance:
object DataFactoryBase object
Implements:
IDataFactory

Constructors

TypeDescriptorFactory()

Initializes an instance of the class.

public TypeDescriptorFactory()

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 override 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.

CreateCollectionPropertyModel(object, PropertyDescriptor, IDataFactoryRequest)

Creates an IPropertyModel for the specified collection data object.

protected virtual IPropertyModel CreateCollectionPropertyModel(object target, PropertyDescriptor propertyDescriptor, IDataFactoryRequest request)
Parameter Type Description
target object

The target object that owns the property.

propertyDescriptor PropertyDescriptor

The PropertyDescriptor for the property be accessed on the target.

request IDataFactoryRequest

An IDataFactoryRequest that contains data about the request.

Returns

IPropertyModel:

The IPropertyModel that was created.

CreatePropertyModel(object, PropertyDescriptor, IDataFactoryRequest)

Creates an IPropertyModel for the specified mutable data object.

protected virtual IPropertyModel CreatePropertyModel(object target, PropertyDescriptor propertyDescriptor, IDataFactoryRequest request)
Parameter Type Description
target object

The target object that owns the property.

propertyDescriptor PropertyDescriptor

The PropertyDescriptor for the property be accessed on the target.

request IDataFactoryRequest

An IDataFactoryRequest that contains data about the request.

Returns

IPropertyModel:

The IPropertyModel that was created.

GetDisplayNameFromName(string)

Derives a property's DisplayName from a Name.

protected virtual string GetDisplayNameFromName(string name)
Parameter Type Description
name string

The name to examine.

Returns

string:

The derived display name.

Remarks

This method is primarily used by the AutoConfigurePropertyModel(PropertyModel, IDataFactoryRequest) method.

GetPropertyModels(object, IDataFactoryRequest)

Returns the IPropertyModel collection for the specified data object.

protected override 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.

Inherited Members