Skip to content

Reference

OpcDataTypeMapper Members

Provides an abstract implementation of the IOpcDataTypeMapper interface.

Reference

OpcDataTypeMapper Members ​

Type
OpcDataTypeMapper
Namespace
Opc.UaFx
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0
Also in
Opc.UaFx.Client

Constructors ​

OpcDataTypeMapper ​

protected

Initializes a new instance of the OpcDataTypeMapper class.

csharp
protected OpcDataTypeMapper()
vbnet
Protected Sub New()

Properties ​

SourceType ​

abstract

Gets the Type from an object can be mapped to the TargetType using this OpcDataTypeMapper.

csharp
public abstract Type SourceType { get; }
vbnet
Public MustOverride ReadOnly Property SourceType As Type

Property value

Type

The Type which can be mapped.

TargetType ​

abstract

Gets the Type to that an object is mapped using this OpcDataTypeMapper.

csharp
public abstract Type TargetType { get; }
vbnet
Public MustOverride ReadOnly Property TargetType As Type

Property value

Type

The resulting Type after mapping an object of the SourceType.

Methods ​

Convert ​

Converts the sourceobject to a specific type.

csharp
public object Convert(object source, IFormatProvider provider)
vbnet
Public Function Convert(source As Object, provider As IFormatProvider) As Object

Parameters

NameTypeDescription
sourceObjectThe sourceobject to convert.
providerIFormatProviderThe IFormatProvider to control any formatting which may be necessary for the convertion.

Returns

Object

The converted object determined through the sourceobject and the provider specified.

Implements

Convert

ConvertBack ​

Converts the targetobject to the type from which the value has been created.

csharp
public object ConvertBack(object target, IFormatProvider provider)
vbnet
Public Function ConvertBack(
    target As Object,
    provider As IFormatProvider) As Object

Parameters

NameTypeDescription
targetObjectThe targetobject to convert back.
providerIFormatProviderThe IFormatProvider to control any formatting which may be necessary for the convertion.

Returns

Object

The source object from which target has been created.

Implements

ConvertBack

ConvertBackCore ​

protected · abstract

When implemented in a derived class; converts the targetobject to the type from which the value has been created.

csharp
protected abstract object ConvertBackCore(
    object target,
    IFormatProvider provider)
vbnet
Protected MustOverride Function ConvertBackCore(
    target As Object,
    provider As IFormatProvider) As Object

Parameters

NameTypeDescription
targetObjectThe targetobject to convert back.
providerIFormatProviderThe IFormatProvider to control any formatting which may be necessary for the convertion.

Returns

Object

The source object from which target has been created.

Remarks

This method is only used in case there target is not a null reference (Nothing in Visual Basic).

ConvertCore ​

protected · abstract

When implemented in a derived class; converts the sourceobject to a specific type.

csharp
protected abstract object ConvertCore(object source, IFormatProvider provider)
vbnet
Protected MustOverride Function ConvertCore(
    source As Object,
    provider As IFormatProvider) As Object

Parameters

NameTypeDescription
sourceObjectThe sourceobject to convert.
providerIFormatProviderThe IFormatProvider to control any formatting which may be necessary for the convertion.

Returns

Object

The converted object determined through the sourceobject and the provider specified.

Remarks

This method is only used in case there source is not a null reference (Nothing in Visual Basic).

Convertible ​

static

Provides an OpcDataTypeMapper which utilizes the IConvertible interface implemented by the TSource and TTarget types.

csharp
public static OpcDataTypeMapper Convertible<TSource, TTarget>()
    where TSource : IConvertible
    where TTarget : IConvertible
vbnet
Public Shared Function Convertible(Of TSource As IConvertible, TTarget As IConvertible)() As OpcDataTypeMapper

Type parameters

NameDescription
TSourceThe Type implementing the IConvertible interface and which is to be mapped to the TTarget type.
TTargetThe resulting Type (implementing the IConvertible interface) after mapping an object of the TSource type.

Returns

OpcDataTypeMapper

An instance of the OpcDataTypeMapper class utilizing the IConvertible implementations of the TSource and TTarget to convert between the types.

Delegate ​

static

Provides an OpcDataTypeMapper which uses the convert and convertBack delegates.

csharp
public static OpcDataTypeMapper Delegate<TSource, TTarget>(
    Func<TSource, IFormatProvider, TTarget> convert,
    Func<TTarget, IFormatProvider, TSource> convertBack)
vbnet
Public Shared Function [Delegate](Of TSource, TTarget)(
    convert As Func(Of TSource, IFormatProvider, TTarget),
    convertBack As Func(Of TTarget, IFormatProvider, TSource)) As OpcDataTypeMapper

Type parameters

NameDescription
TSourceThe Type which is to be mapped to the TTarget type.
TTargetThe resulting Type after mapping an object of the TSource type.

Parameters

NameTypeDescription
convertFunc<TSource, IFormatProvider, TTarget>The delegate to use to map the TSourceobject to the TTarget type.
convertBackFunc<TTarget, IFormatProvider, TSource>The delegate to use to map the TTargetobject back to the TSource type.

Returns

OpcDataTypeMapper

Exceptions

ExceptionCondition
ArgumentNullExceptionThe convert or convertBack is a null reference (Nothing in Visual Basic).