Class ConverterBase<TSource, TTarget>
Represents a base implementation for IConverter interface with the basic logic necessary for value converter from the TSource type to the TTarget type.
Представляет базовую реализацию для интерфейса IConverter с основной логикой необходимой для конвертера значений из типа TSource в тип TTarget.
Inheritance
Implements
Inherited Members
Namespace: Platform.Converters
Assembly: Platform.Converters.dll
Syntax
public abstract class ConverterBase<TSource, TTarget> : IConverter<TSource, TTarget>
Type Parameters
| Name | Description |
|---|---|
| TSource | Source type of conversion. Исходный тип конверсии. |
| TTarget | Target type of conversion. Целевой тип конверсии. |
Methods
| Improve this Doc View SourceConvert(TSource)
Declaration
public abstract TTarget Convert(TSource source)
Parameters
| Type | Name | Description |
|---|---|---|
| TSource | source |
Returns
| Type | Description |
|---|---|
| TTarget |
ConvertFromObject(ILGenerator)
Generates a sequence of instructions using TTarget.
Генерирует последовательность инструкций при помощи TTarget.
Declaration
protected static void ConvertFromObject(ILGenerator il)
Parameters
| Type | Name | Description |
|---|---|---|
| ILGenerator | il | An Экземпляр |
CreateTypeInheritedFrom<TBaseClass>()
Converts the value of the source type (TSource) to the value of the target type.
Конвертирует значение исходного типа (TSource) в значение целевого типа.
Declaration
protected static TypeBuilder CreateTypeInheritedFrom<TBaseClass>()
Returns
| Type | Description |
|---|---|
| TypeBuilder | The value is converted to the target type (TTarget). Значение ковертированное в целевой тип (TTarget). |
Type Parameters
| Name | Description |
|---|---|
| TBaseClass |
EmitConvertMethod(TypeBuilder, Action<ILGenerator>)
Converts the value of the source type (TSource) to the value of the target type.
Конвертирует значение исходного типа (TSource) в значение целевого типа.
Declaration
protected static void EmitConvertMethod(TypeBuilder typeBuilder, Action<ILGenerator> emitConversion)
Parameters
| Type | Name | Description |
|---|---|---|
| TypeBuilder | typeBuilder | |
| Action<ILGenerator> | emitConversion |
GetMethodForConversionToTargetType()
Converts the value of the source type (TSource) to the value of the target type.
Конвертирует значение исходного типа (TSource) в значение целевого типа.
Declaration
protected static MethodInfo GetMethodForConversionToTargetType()
Returns
| Type | Description |
|---|---|
| MethodInfo | The value is converted to the target type (TTarget). Значение ковертированное в целевой тип (TTarget). |
GetNewName()
Gets a new unique name of an assembly.
Возвращает новое уникальное имя сборки.
Declaration
protected static string GetNewName()
Returns
| Type | Description |
|---|---|
| String | A new unique name of an assembly. Новое уникальное имя сборки. |
LoadDefault(ILGenerator, Type)
Converts the value of the source type (TSource) to the value of the target type.
Конвертирует значение исходного типа (TSource) в значение целевого типа.
Declaration
protected static void LoadDefault(ILGenerator il, Type targetType)
Parameters
| Type | Name | Description |
|---|---|---|
| ILGenerator | il | |
| Type | targetType |