Click or drag to resize

BinaryConvertCanConvert Method

Returns true if ConvertType can perform a conversion.

Namespace:  Demo3D.IO
Assembly:  Demo3D.IO (in Demo3D.IO.dll) Version: 15.0.2.11458
Syntax
C#
public static bool CanConvert(
	Type sourceType,
	Type destinationType,
	bool castTypes = true
)

Parameters

sourceType
Type: SystemType
The source type.
destinationType
Type: SystemType
The destination type.
castTypes (Optional)
Type: SystemBoolean
False if the conversion should be lossless.

Return Value

Type: Boolean
True if ConvertType can perform a conversion.
Remarks

If castTypes is true, then BinaryConvert will attempt any conversion, including conversions that lose data (eg unsigned to signed int, int to bool, or string to int). If it's false, then BinaryConvert will only attempt lossless conversions (eg int16 to int32).

See Also