TypeConvertorCollection class
Contains a collection of converters that provides a way to convert the specific type to custom string bypassing other rules.
Namespace: TypeLite
Methods
| Name | Description | |
|---|---|---|
| ConvertType | Converts specific type to its string representation. | |
| IsConvertorRegistered | Checks whether any converter is registered for the specific Type | |
| RegisterTypeConverter<TFor> | Registers the converter for the specific Type |
TypeConvertorCollection.ConvertType method
Converts specific type to its string representation.
Syntax
Parameters
-
Typetype - The type to convert
Returns
-
string - the string representation of the type if a converter of the type is registered otherwise return null
TypeConvertorCollection.IsConvertorRegistered method
Checks whether any converter is registered for the specific Type
Syntax
Parameters
-
Typetype - The type to check
Returns
-
bool - true if a converter is registered for the specific Type otherwise return false
TypeConvertorCollection.RegisterTypeConverter<TFor> method
Registers the converter for the specific Type
Syntax
Parameters
-
TypeConvertorconvertor - The converter to register