KGy SOFT

TypeExtensionsRegisterTypeConverterTConverter Method

KGy SOFT Core Libraries Help
Registers a type converter for a type.

Namespace:  KGySoft.CoreLibraries
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 5.4.0
Syntax

public static void RegisterTypeConverter<TConverter>(
	this Type type
)
where TConverter : TypeConverter

Parameters

type
Type: SystemType
The Type to be associated with the new TConverter.

Type Parameters

TConverter
The TypeConverter to be registered.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks

After calling this method the TypeDescriptor.GetConverter method will return the converter defined in TConverter.

Note Note
Please note that if TypeDescriptor.GetConverter has already been called for type before registering the new converter, then the further calls after the registering may continue to return the original converter. So make sure you register your custom converters at the start of your application.
See Also

Reference