ConfigurationConverterBase.CanConvertFrom Method (ITypeDescriptorContext, Type)

Note: This method is new in the .NET Framework version 2.0.

Determines whether the conversion is allowed.

Namespace: System.Configuration
Assembly: System.Configuration (in system.configuration.dll)

public:
virtual bool CanConvertFrom (
	ITypeDescriptorContext^ ctx, 
	Type^ type
) override
public boolean CanConvertFrom (
	ITypeDescriptorContext ctx, 
	Type type
)
public override function CanConvertFrom (
	ctx : ITypeDescriptorContext, 
	type : Type
) : boolean

Parameters

ctx

The ITypeDescriptorContext object used for type conversions.

type

The Type to convert from.

Return Value

true if the conversion is allowed; otherwise, false.

The CanConvertFrom method determines whether a conversion can be performed on strongly typed properties to obtain value strings used in the configuration file.

The following example code shows how to override the CanConvertFrom method to create a custom TimeSpan converter type. Also, the example shows how to use this type in a custom section.

No code example is currently available or this language may not be supported.

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

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: