Class ConverterFactoryDynamic
- Namespace
- Dec
- Assembly
- dec.dll
Alternate dynamic-typed class for converting to arbitrary types via the Recorder API, with full control over the object creation process.
public abstract class ConverterFactoryDynamic : ConverterFactory
- Inheritance
-
objectConverterConverterFactoryConverterFactoryDynamic
Remarks
This is a variant of ConverterFactory that allows you to use arbitrary types, which is helpful if you're trying to convert non-public types.
In most cases it should be avoided.
Methods
Create(Recorder)
Creates an object.
public abstract object Create(Recorder recorder)
Parameters
recorder
Recorder
Returns
- object
Remarks
This is similar to Dec.IRecordable.Record
, although you'll need to use this
instead of input
.
This function will not be called if an instance already exists. In addition, you cannot reference other shared objects within Create, even transitively. Those must be referenced within Read. It is recommended that you do the bare minimum here to create the necessary object.
Read(ref object, Recorder)
Reads an object.
public abstract void Read(ref object input, Recorder recorder)
Parameters
input
objectrecorder
Recorder
Remarks
This is similar to Dec.IRecordable.Record
, although you'll need to use this
instead of input
.
Write(object, Recorder)
Writes an object.
public abstract void Write(object input, Recorder recorder)
Parameters
input
objectrecorder
Recorder
Remarks
See Dec.IRecordable.Record
for details, although you'll need to use this
instead of input
.