DataSourceIDConverter.CanConvertFrom(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 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.
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.