Version 2.1.0.0

IFormatter interface

Namespace: Sirenix.Serialization
Assembly: Sirenix.Serialization
public interface IFormatter
Serializes and deserializes a given type.

NOTE that if you are implementing a custom formatter and registering it using the Sirenix.Serialization.CustomFormatterAttribute, it is not enough to implement IFormatter - you have to implement IFormatter<T>.

Properties

SerializedType
Gets the type that the formatter can serialize.
Type SerializedType { get; }

Methods

Deserialize(IDataReader)
Deserializes a value using a specified IDataReader.
object Deserialize(IDataReader reader)
Parameters
IDataReader reader

The reader to use.

Returns
System.Object

The deserialized value.

Serialize(Object, IDataWriter)
Serializes a value using a specified IDataWriter.
void Serialize(object value, IDataWriter writer)
Parameters
System.Object value

The value to serialize.

IDataWriter writer

The writer to use.