Version 2.1.0.0

ISelfFormatter interface

Namespace: Sirenix.Serialization
Assembly: Sirenix.Serialization
public interface ISelfFormatter
Specifies that a type is capable of serializing itself using an IDataWriter and an IDataReader.

The deserialized type instance will be created without a constructor call using the System.Runtime.Serialization.FormatterServices.GetUninitializedObject(System.Type) method if it is a reference type, otherwise it will be created using default(type).

Use AlwaysFormatsSelfAttribute to specify that a class which implements this interface should *always* format itself regardless of other formatters being specified.

Methods

Deserialize(IDataReader)
Deserializes data into the instance using the given reader.
void Deserialize(IDataReader reader)
Parameters
IDataReader reader

Serialize(IDataWriter)
Serializes the instance's data using the given writer.
void Serialize(IDataWriter writer)
Parameters
IDataWriter writer