DataFieldConverter.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 the converter can convert an object of 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 ITypeDescriptorContext object that can be used to gain additional context information.
Returns
true
if the converter can perform the conversion; otherwise, false
.
Remarks
This method returns true
if the source type is a string. Otherwise, this method always returns false
.
Notes to Inheritors
Override this method to meet your own conversion requirements.
The context
parameter can be used to extract additional information about the environment the converter is being invoked from. It might be null
, so you should always check. Also, properties of the context
object might also return null
.
Applies to
See also
.NET