DataSourceIDConverter.CanConvertFrom Method (ITypeDescriptorContext, Type)

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

Namespace: System.Web.UI.Design.WebControls
Assembly: System.Design (in system.design.dll)

public:
virtual bool CanConvertFrom (
	ITypeDescriptorContext^ context, 
	Type^ sourceType
) override
public boolean CanConvertFrom (
	ITypeDescriptorContext context, 
	Type sourceType
)
public override function CanConvertFrom (
	context : ITypeDescriptorContext, 
	sourceType : Type
) : boolean
Not applicable.

Parameters

context

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

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

Return Value

true if sourceType is a string; otherwise, false.

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.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: