編輯

共用方式為


DataColumnSelectionConverter.CanConvertFrom Method

Definition

Indicates whether the specified source type can be converted to the type of the associated control property.

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

Parameters

context
ITypeDescriptorContext

An ITypeDescriptorContext implementation that can be used to gain additional context information.

sourceType
Type

The type to convert from.

Returns

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

Remarks

Call the CanConvertFrom method to determine whether the ConvertFrom method supports converting the source type.

The ConvertFrom method can convert only from a string, so the CanConvertFrom method returns true when sourceType is a string.

Applies to