Class
TypeRegister<P>

Provides a base class for registering and managing type conversions between source and target types.

Definition

Namespace:Telerik.Maui.Controls.Compatibility.Common

Assembly:Telerik.Maui.Controls.Compatibility.dll

Type Parameters:

P

The target platform type for conversions.

Syntax:

cs-api-definition
public abstract class TypeRegister<P>

Inheritance: objectTypeRegister<P>

Derived Classes: TypeRegister

Constructors

TypeRegister()

Initializes a new instance of the TypeRegister<P> class.

Declaration

cs-api-definition
protected TypeRegister()

Methods

GetNativeObjectCore(object)

When overridden in a derived class, gets the platform-specific representation of the object.

Declaration

cs-api-definition
protected abstract P GetNativeObjectCore(object value)

Parameters

value

object

The object to convert.

Returns

P

The platform-specific representation.

GetNativeTypeCore(Type)

When overridden in a derived class, gets the platform-specific type for the specified type.

Declaration

cs-api-definition
protected abstract Type GetNativeTypeCore(Type type)

Parameters

type

Type

The source type.

Returns

Type

The platform-specific type.

GetObjectCore(P, Type, object)

When overridden in a derived class, gets the object representation from the platform-specific value.

Declaration

cs-api-definition
protected abstract object GetObjectCore(P value, Type clrType, object context)

Parameters

value

P

The platform-specific value to convert.

clrType

Type

The CLR type to convert to.

context

object

The conversion context.

Returns

object

The converted object.

GetTypeConverter(Type, Type)

When overridden in a derived class, gets a type converter for the specified types.

Declaration

cs-api-definition
protected abstract ITypeConverter<P> GetTypeConverter(Type type, Type nativeType)

Parameters

type

Type

The source type.

nativeType

Type

The target native type.

Returns

ITypeConverter<P>

A type converter for the specified types.

Register(Type, Type, ITypeConverter<P>)

Registers a type converter for the specified source and target types.

Declaration

cs-api-definition
public static void Register(Type sourceType, Type targetType, ITypeConverter<P> converter)

Parameters

sourceType

Type

The source type to convert from.

targetType

Type

The target type to convert to.

converter

ITypeConverter<P>

The type converter to use for the conversion.

Register<O, N>()

Registers a type converter for the specified generic source and target types.

Declaration

cs-api-definition
public static void Register<O, N>() where N : P