Version 2.1.0.0

ISerializationPolicy interface

Namespace: Sirenix.Serialization
Assembly: Sirenix.Serialization
public interface ISerializationPolicy
Defines which members to serialize and deserialize when there aren't any custom formatters for a type. Usually, it governs the behaviour of the FormatterEmitter and ReflectionFormatter<T> classes.

Properties

AllowNonSerializableTypes
Gets a value indicating whether to allow non serializable types. (Types which are not decorated with System.SerializableAttribute.)
bool AllowNonSerializableTypes { get; }
ID
Gets the identifier of the policy. This can be stored in the serialization metadata, so the policy used to serialize can be recovered upon deserialization without knowing the policy ahead of time. This ID should preferably be unique.
string ID { get; }

Methods

ShouldSerializeMember(MemberInfo)
Gets a value indicating whether a given System.Reflection.MemberInfo should be serialized or not.
bool ShouldSerializeMember(MemberInfo member)
Parameters
System.Reflection.MemberInfo member

The member to check.

Returns
System.Boolean

true if the given member should be serialized, otherwise, false.