Interface IRecordable
- Namespace
- Dec
- Assembly
- dec.dll
Base class for recordable elements.
public interface IRecordable
Remarks
Inheriting from this is the easiest way to support Recorder serialization.
If you need to record a class that you can't modify the definition of, see the Converter system.
Methods
Record(Recorder)
Serializes or deserializes this object to Recorder.
void Record(Recorder recorder)
Parameters
recorder
Recorder
Examples
public void Record(Recorder recorder)
{
// The Recorder interface figures out the right thing based on context.
// Any members that are referenced elsewhere will be turned into refs automatically.
// Members that don't show up in the saved data will be left at their default value.
recorder.Record(ref integerMember, "integerMember");
recorder.Record(ref classMember, "classMember");
recorder.Record(ref structMember, "structMember");
recorder.Record(ref collectionMember, "collectionMember");
}
Remarks
This function is called both for serialization and deserialization. In most cases, you can simply call Recorder.Record functions to do the right thing.
For more complicated requirements, check out Recorder's interface.