NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

TypeConverter.CanConvertFrom (ITypeDescriptorContext, Type)

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

[Visual Basic]
Overloads Overridable Public Function CanConvertFrom( _
   ByVal context As ITypeDescriptorContext, _
   ByVal sourceType As Type _
) As Boolean
[C#]
public virtual bool CanConvertFrom(
   ITypeDescriptorContext context,
   Type sourceType
);
[C++]
public: virtual bool CanConvertFrom(
   ITypeDescriptorContext* context,
   Type* sourceType
);
[JScript]
public function CanConvertFrom(
   context : ITypeDescriptorContext,
   sourceType : Type
) : Boolean;

Parameters

context
An ITypeDescriptorContext that represents a context for the formatter.
sourceType
A Type that represents the type you wish to convert from.

Return Value

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

Remarks

The context can be used to extract additional information about the environment this converter is being invoked from. This may be a null reference (in Visual Basic Nothing), so you should always check. Also, properties on the context object may also return a null reference (Nothing).

See Also

TypeConverter Class | TypeConverter Members | System.ComponentModel Namespace | TypeConverter.CanConvertFrom Overload List | ITypeDescriptorContext