Table of Contents

Class SerializerSelector

Namespace
Stride.Core.Serialization
Assembly
Stride.Core.dll

Serializer context. It holds DataSerializer{T} objects and their factories.

public class SerializerSelector
Inheritance
SerializerSelector

Constructors

SerializerSelector(bool, bool, params string[])

Initializes a new instance of the SerializerSelector class.

public SerializerSelector(bool reuseReferences, bool externalIdentifiableAsGuid, params string[] profiles)

Parameters

reuseReferences bool

if set to true reuse references (allow cycles in the object graph).

externalIdentifiableAsGuid bool
profiles string[]

The profiles.

SerializerSelector(params string[])

public SerializerSelector(params string[] profiles)

Parameters

profiles string[]

Fields

SelectorOverride

public SerializerSelector SelectorOverride

Field Value

SerializerSelector

Properties

Asset

public static SerializerSelector Asset { get; }

Property Value

SerializerSelector

AssetWithReuse

public static SerializerSelector AssetWithReuse { get; }

Property Value

SerializerSelector

Default

Gets the default instance of Serializer.

public static SerializerSelector Default { get; }

Property Value

SerializerSelector

The default instance.

ExternalIdentifiableAsGuid

Gets whether IIdentifiable instances marked as external will have only their Guid stored.

public bool ExternalIdentifiableAsGuid { get; }

Property Value

bool

Profiles

public IEnumerable<string> Profiles { get; }

Property Value

IEnumerable<string>

ReuseReferences

Gets whether serialization reuses references, where each reference gets assigned an ID and if it is serialized again, same instance will be reused).

public bool ReuseReferences { get; }

Property Value

bool

SerializerFactories

public List<SerializerFactory> SerializerFactories { get; }

Property Value

List<SerializerFactory>

Methods

EnsureInitialized(DataSerializer)

Internal function, for use by SerializerFactory.

public void EnsureInitialized(DataSerializer dataSerializer)

Parameters

dataSerializer DataSerializer

The data serializer to initialize if not done yet

GetSerializer(ref ObjectId)

public DataSerializer GetSerializer(ref ObjectId typeId)

Parameters

typeId ObjectId

Returns

DataSerializer

GetSerializer(Type)

Gets the serializer.

public DataSerializer GetSerializer(Type type)

Parameters

type Type

The type that you want to (de)serialize.

Returns

DataSerializer

The DataSerializer<T> for this type if it exists or can be created, otherwise null.

GetSerializer<T>()

Gets the serializer.

public DataSerializer<T> GetSerializer<T>()

Returns

DataSerializer<T>

The DataSerializer<T> for this type if it exists or can be created, otherwise null.

Type Parameters

T

The type that you want to (de)serialize.

HasProfile(string)

Checks if this instance supports the specified serialization profile.

public bool HasProfile(string profile)

Parameters

profile string

Name of the profile

Returns

bool

true if this instance supports the specified serialization profile