Version 2.1.0.0

DelegateFormatter<T> class

Namespace: Sirenix.Serialization
Assembly: Sirenix.Serialization
public sealed class DelegateFormatter<T> : BaseFormatter<T>, IFormatter<T>, IFormatter where T : class
Formatter for all delegate types.

This formatter can handle anything but delegates for dynamic methods.

Inheritance
See Also

Type Parameters

T

Constructors

DelegateFormatter()
public DelegateFormatter()

Methods

DeserializeImplementation(ref T, IDataReader)
Provides the actual implementation for deserializing a value of type .
protected override void DeserializeImplementation(ref T value, IDataReader reader)
Parameters
T value

The uninitialized value to serialize into. This value will have been created earlier using OdinSerializer.BaseFormatter`1.GetUninitializedObject.

Sirenix.Serialization.IDataReader reader

The reader to deserialize with.

GetUninitializedObject()
Get an uninitialized object of type . WARNING: If you override this and return null, the object's ID will not be automatically registered and its OnDeserializing callbacks will not be automatically called, before deserialization begins. You will have to call OdinSerializer.BaseFormatter`1.RegisterReferenceID(`0,OdinSerializer.IDataReader) and OdinSerializer.BaseFormatter`1.InvokeOnDeserializingCallbacks(`0,OdinSerializer.DeserializationContext) immediately after creating the object yourself during deserialization.
protected override T GetUninitializedObject()
Returns
T

An uninitialized object of type .

SerializeImplementation(ref T, IDataWriter)
Provides the actual implementation for serializing a value of type .
protected override void SerializeImplementation(ref T value, IDataWriter writer)
Parameters
T value

The value to serialize.

Sirenix.Serialization.IDataWriter writer

The writer to serialize with.