Redigeeri

Jagamisviis:


SelectionRangeConverter.CanConvertTo(ITypeDescriptorContext, Type) Method

Definition

Gets a value indicating whether this converter can convert an object to the specified destination type by using the specified context.

public:
 override bool CanConvertTo(System::ComponentModel::ITypeDescriptorContext ^ context, Type ^ destinationType);
public override bool CanConvertTo (System.ComponentModel.ITypeDescriptorContext context, Type destinationType);
public override bool CanConvertTo (System.ComponentModel.ITypeDescriptorContext? context, Type? destinationType);
override this.CanConvertTo : System.ComponentModel.ITypeDescriptorContext * Type -> bool
Public Overrides Function CanConvertTo (context As ITypeDescriptorContext, destinationType As Type) As Boolean

Parameters

context
ITypeDescriptorContext

A ITypeDescriptorContext that provides a format context.

destinationType
Type

The destination Type to convert into.

Returns

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

Remarks

The CanConvertTo method returns true if the destinationType parameter is of type String or InstanceDescriptor. Otherwise, it defers the call to the base implementation of this method, TypeConverter.CanConvertTo(ITypeDescriptorContext, Type).

Notes to Inheritors

Override this method to provide your own conversion requirements.

The context parameter can be used to extract additional information about the environment this converter is being invoked from. The parameter may be null, so you should always verify the information. Also, properties on the context object may also return null.

Applies to

See also