Skip to main content

MLAPI.Serialization.SerializationManager

Helper class to manage the MLAPI serialization.

Inheritance#

System.Dynamic.ExpandoObject

System.Dynamic.ExpandoObject

Inherited Members#

Object.Equals(Object)

Object.Equals(Object, Object)

Object.GetHashCode()

Object.GetType()

Object.MemberwiseClone()

Object.ReferenceEquals(Object, Object)

Object.ToString()

Namespace: System.Dynamic.ExpandoObject#
Assembly: MLAPI.dll#
Syntax#
public static class SerializationManager

Methods#

IsTypeSupported(Type)#

Returns if a type is supported for serialization

Declaration#

public static bool IsTypeSupported(Type type)

Parameters#

TypeNameDescription
System.TypetypeThe type to check

Returns#

TypeDescription
System.BooleanWhether or not the type is supported

RegisterSerializationHandlers<T>(SerializationManager.CustomSerializationDelegate<T>, SerializationManager.CustomDeserializationDelegate<T>)#

Registers a custom serialization and deserialization pair for a object. This is useful for writing objects that are behind the third party wall. Such as .NET types.

Declaration#

public static void RegisterSerializationHandlers<T>(SerializationManager.CustomSerializationDelegate<T> onSerialize, SerializationManager.CustomDeserializationDelegate<T> onDeserialize)

Parameters#

TypeNameDescription
SerializationManager.CustomSerializationDelegate<T>onSerializeThe delegate to invoke to serialize the type.
SerializationManager.CustomDeserializationDelegate<T>onDeserializeThe delegate to invoke to deserialize the type.

Type Parameters#

NameDescription
TThe type to register.

RemoveSerializationHandlers<T>()#

Removes a serialization handler that was registered previously for a specific type. This will remove both the serialization and deserialization handler.

Declaration#

public static bool RemoveSerializationHandlers<T>()

Returns#

TypeDescription
System.BooleanWhether or not either the serialization or deserialization handlers for the type was removed.

Type Parameters#

NameDescription
TThe type for the serialization handlers to remove.