Επεξεργασία

Κοινή χρήση μέσω


DataSourceIDConverter.CanConvertFrom(ITypeDescriptorContext, Type) Method

Definition

Gets a value indicating whether this converter can convert an object in the specified source type to the native type of the converter.

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 object implementing the ITypeDescriptorContext that provides information about a context to a type converter so that the type converter can perform a conversion.

sourceType
Type

The Type of the object for which conversion is being requested.

Returns

true if sourceType is a string; otherwise, false.

Remarks

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

The CanConvertFrom does not use the context parameter.

Applies to

See also