SelectionRangeConverter.CanConvertTo(ITypeDescriptorContext, Type) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
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
.