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: 19.00.00
Syntax
C#
public static bool CanConvert(
	Type sourceType,
	Type destinationType,
	bool castTypes = true
)

Parameters

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

Return Value

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