System.ComponentModel.TypeConverter.CanConvertTo Method

Returns whether this converter can convert the object to the specified type, using the specified context.

Syntax

public virtual bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)

Parameters

context
An System.ComponentModel.ITypeDescriptorContext that provides a format context.
destinationType
A Type that represents the type you want to convert to.

Returns

true if this converter can perform the conversion; otherwise, false.

Remarks

Use the context parameter to extract additional information about the environment from which this converter is invoked. This parameter can be null, so always check it. Also, properties on the context object can return null.

If destinationType is a string, the default implementation of erload:System.ComponentModel.TypeConverter.CanConvertTo always returns true.

Requirements

Namespace: System.ComponentModel
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0