TypeDescriptor.GetConverter TypeDescriptor.GetConverter TypeDescriptor.GetConverter TypeDescriptor.GetConverter Method

Definition

Returns a type converter for a component or a type.

Overloads

GetConverter(Object) GetConverter(Object) GetConverter(Object) GetConverter(Object)

Returns a type converter for the type of the specified component.

GetConverter(Type) GetConverter(Type) GetConverter(Type)

Returns a type converter for the specified type.

GetConverter(Object, Boolean) GetConverter(Object, Boolean) GetConverter(Object, Boolean) GetConverter(Object, Boolean)

Returns a type converter for the type of the specified component with a custom type descriptor.

GetConverter(Object) GetConverter(Object) GetConverter(Object) GetConverter(Object)

Returns a type converter for the type of the specified component.

public:
 static System::ComponentModel::TypeConverter ^ GetConverter(System::Object ^ component);
public static System.ComponentModel.TypeConverter GetConverter (object component);
static member GetConverter : obj -> System.ComponentModel.TypeConverter
Public Shared Function GetConverter (component As Object) As TypeConverter

Parameters

component
Object Object Object Object

A component to get the converter for.

Returns

Exceptions

Examples

For an example of using this method, see the TypeConverter class.

Remarks

This method locates an appropriate type converter by looking for a TypeConverterAttribute. If it cannot find a TypeConverterAttribute, it traverses the base class hierarchy of the class until it finds a primitive type.

This method is equivalent to the overloaded GetConverter method with a second parameter of false.

See Also

GetConverter(Type) GetConverter(Type) GetConverter(Type)

Returns a type converter for the specified type.

public:
 static System::ComponentModel::TypeConverter ^ GetConverter(Type ^ type);
public static System.ComponentModel.TypeConverter GetConverter (Type type);
static member GetConverter : Type -> System.ComponentModel.TypeConverter

Parameters

type
Type Type Type Type

The Type of the target component.

Returns

Exceptions

Remarks

Call this version of this method only when you do not have an instance of the object.

This method looks for the appropriate type converter by looking for a TypeConverterAttribute. If it cannot find a TypeConverterAttribute, it traverses the base class hierarchy of the class until it finds a primitive type.

See Also

GetConverter(Object, Boolean) GetConverter(Object, Boolean) GetConverter(Object, Boolean) GetConverter(Object, Boolean)

Returns a type converter for the type of the specified component with a custom type descriptor.

public:
 static System::ComponentModel::TypeConverter ^ GetConverter(System::Object ^ component, bool noCustomTypeDesc);
public static System.ComponentModel.TypeConverter GetConverter (object component, bool noCustomTypeDesc);
static member GetConverter : obj * bool -> System.ComponentModel.TypeConverter
Public Shared Function GetConverter (component As Object, noCustomTypeDesc As Boolean) As TypeConverter

Parameters

component
Object Object Object Object

A component to get the converter for.

noCustomTypeDesc
Boolean Boolean Boolean Boolean

true to consider custom type description information; otherwise, false.

Returns

Exceptions

Remarks

This method looks for the appropriate type converter by trying to find a TypeConverterAttribute. If it cannot find a TypeConverterAttribute, it traverses the base class hierarchy of the class until it finds a primitive type.

See Also

Applies to