Open sandboxFocus

Method IsConvertibleTo

IsConvertibleTo(IType, IType, ConversionKind, TypeComparison)

Equivalent to the is operator in C#. Gets a value indicating whether the current type is assignable to another given type, given as an IType.

Declaration
public static bool IsConvertibleTo(this IType left, IType right, ConversionKind kind = ConversionKind.Default, TypeComparison typeComparison = TypeComparison.Default)
Parameters
Type Name Description
IType left

The source type.

IType right

The target type.

ConversionKind kind

The kind of conversion to check.

TypeComparison typeComparison

The type comparison strategy to use.

Returns
Type Description
bool

true if left is convertible to right; otherwise, false.

IsConvertibleTo(IType, Type, ConversionKind, TypeComparison)

Equivalent to the is operator in C#. Gets a value indicating whether the current type is assignable to another given type, given as a reflection Type.

Declaration
public static bool IsConvertibleTo(this IType left, Type right, ConversionKind kind = ConversionKind.Default, TypeComparison typeComparison = TypeComparison.Default)
Parameters
Type Name Description
IType left

The source type.

Type right

The target type.

ConversionKind kind

The kind of conversion to check.

TypeComparison typeComparison

The type comparison strategy to use.

Returns
Type Description
bool

true if left is convertible to right; otherwise, false.

IsConvertibleTo(IType, SpecialType, ConversionKind)

Equivalent to the is operator in C#. Gets a value indicating whether the current type is assignable to another given type, given as a SpecialType.

Declaration
public static bool IsConvertibleTo(this IType left, SpecialType right, ConversionKind kind = ConversionKind.Default)
Parameters
Type Name Description
IType left

The source type.

SpecialType right

The target special type.

ConversionKind kind

The kind of conversion to check.

Returns
Type Description
bool

true if left is convertible to right; otherwise, false.