Click or drag to resize

TypeConverterCreate Method (Type, IDictionaryString, Object, CultureInfo)

Creates a new instance of the given type by mapping the key value pairs of the given dictionary to constructor parameters, public properties and public fields of the given type. Throws an InstantiationException if creation failed. For success, at least on key value pair must be used as a constructor parameter, public property or public field. If the dictionary contains only one key value pair, its value is returned if it is exactly of the demanded type.

Namespace:  TB.ComponentModel
Assembly:  UniversalTypeConverter (in UniversalTypeConverter.dll) Version: 2.0.0
Syntax
C#
public Object Create(
	Type destinationType,
	IDictionary<string, Object> propertyValues,
	CultureInfo culture = null
)

Parameters

destinationType
Type: SystemType
The type of the instance to create.
propertyValues
Type: System.Collections.GenericIDictionaryString, Object
Values which are mapped to constructor parameters, public properties and public fields of the same name as their key. Names are compared case insensitive. The constructor with most of the resolvable parameters is used.
culture (Optional)
Type: System.GlobalizationCultureInfo
The culture to use on conversion. If not given or null, the DefaultCulture is used.

Return Value

Type: Object
The created instance.
Exceptions
ExceptionCondition
InstantiationExceptionInstantiationException if creation failed.
See Also