Version 3.3.1.2

SerializationConfig class

Namespace: Sirenix.Serialization
Assembly: Sirenix.Serialization
public class SerializationConfig
Defines the configuration during serialization and deserialization. This class is thread-safe.
Inheritance
  • System.Object
  • SerializationConfig

Constructors

SerializationConfig()
Initializes a new instance of the SerializationConfig class.
public SerializationConfig()

Fields

AllowDeserializeInvalidData

Setting this member to true indicates that in the case where, when expecting to deserialize an instance of a certain type, but encountering an incompatible, uncastable type in the data being read, the serializer should attempt to deserialize an instance of the expected type using the stored, possibly invalid data.

This is equivalent to applying the AllowDeserializeInvalidData attribute, except global instead of specific to a single type. Note that if this member is set to false, individual types may still be deserialized with invalid data if they are decorated with the AllowDeserializeInvalidData attribute.

public bool AllowDeserializeInvalidData

Properties

DebugContext
Gets or sets the debug context. This value is never null; if set to null, a new default instance of DebugContext will be created upon the next get.
public DebugContext DebugContext { get; set; }
SerializationPolicy
Gets or sets the serialization policy. This value is never null; if set to null, it will default to Unity.
public ISerializationPolicy SerializationPolicy { get; set; }

Methods

ResetToDefault()
Resets the configuration to a default configuration, as if the constructor had just been called.
public void ResetToDefault()