Namespace: | Sirenix.Serialization |
Assembly: | Sirenix.Serialization |
public static class SerializationPolicies
NOTE: Policies are not necessarily compatible with each other in intuitive ways. Data serialized with the Everything policy will for example fail to deserialize auto-properties with Strict, even if only strict data is needed. It is best to ensure that you always use the same policy for serialization and deserialization.
This class and all of its policies are thread-safe.
public static ISerializationPolicy Everything { get; }
There are two exceptions:
1) All fields in private nested types marked as compiler generated (e.g. lambda capture classes) are also serialized.
2) Virtual auto-properties are never serialized. Note that properties specified by an implemented interface are automatically marked virtual by the compiler.
public static ISerializationPolicy Strict { get; }
There are two exceptions:
1) All fields in tuples, as well as in private nested types marked as compiler generated (e.g. lambda capture classes) are also serialized.
2) Virtual auto-properties are never serialized. Note that properties specified by an implemented interface are automatically marked virtual by the compiler.
public static ISerializationPolicy Unity { get; }
public static bool TryGetByID(string name, out ISerializationPolicy policy)
System.String | name | |
Sirenix.Serialization.ISerializationPolicy | policy |
System.Boolean |