Click or drag to resize

DataConverterCanConvertFrom Method

Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context.

Namespace:  Demo3D.PLC.Comms
Assembly:  PLC (in PLC.dll) Version: 15.0.2.11458
Syntax
C#
public virtual bool CanConvertFrom(
	IDataContextProvider? contextProvider,
	DataType sourceType,
	DataType destinationType
)

Parameters

contextProvider
Type: Demo3D.PLC.CommsIDataContextProvider
Conversion context provider (or null).
sourceType
Type: Demo3D.PLC.CommsDataType
The data type to be converted from.
destinationType
Type: Demo3D.PLC.CommsDataType
The data type to convert to.

Return Value

Type: Boolean
True is this converter can perform the conversion.
Remarks

When setting up a conversion, the contextProvider passed to this function and to GetConvertFrom(IDataContextProvider, DataType, DataType) and to the ConversionDelegate returned, must all be the same.

Each instance of the IDataContextProvider is supposed to provide the context for one particular conversion for one particular data stream.

See Also