Table of Contents

Class AssetYamlSerializer

Namespace
Stride.Core.Yaml
Assembly
Stride.Core.Assets.dll

Default Yaml serializer used to serialize assets by default.

public class AssetYamlSerializer : YamlSerializerBase, IDisposable
Inheritance
YamlSerializerBase
AssetYamlSerializer
Implements
Inherited Members
YamlSerializerBase.RegisteredAssemblies
YamlSerializerBase.Lock
YamlSerializerBase.Dispose()
Extension Methods

Properties

Default

public static AssetYamlSerializer Default { get; set; }

Property Value

AssetYamlSerializer

Methods

Deserialize(EventReader, object, Type, out PropertyContainer, SerializerContextSettings)

Deserializes an object from the specified stream (expecting a YAML string).

public object Deserialize(EventReader eventReader, object value, Type expectedType, out PropertyContainer contextProperties, SerializerContextSettings contextSettings = null)

Parameters

eventReader EventReader

A YAML event reader.

value object

The value.

expectedType Type

The expected type.

contextProperties PropertyContainer

A dictionary or properties that were generated during deserialization.

contextSettings SerializerContextSettings

The context settings.

Returns

object

An instance of the YAML data.

Deserialize(Stream, Type, SerializerContextSettings)

Deserializes an object from the specified stream (expecting a YAML string).

public object Deserialize(Stream stream, Type expectedType = null, SerializerContextSettings contextSettings = null)

Parameters

stream Stream

A YAML string from a stream.

expectedType Type

The expected type.

contextSettings SerializerContextSettings

The context settings.

Returns

object

An instance of the YAML data.

Deserialize(Stream, Type, SerializerContextSettings, out bool, out PropertyContainer)

Deserializes an object from the specified stream (expecting a YAML string).

public object Deserialize(Stream stream, Type expectedType, SerializerContextSettings contextSettings, out bool aliasOccurred, out PropertyContainer contextProperties)

Parameters

stream Stream

A YAML string from a stream .

expectedType Type

The expected type.

contextSettings SerializerContextSettings

The context settings.

aliasOccurred bool

if set to true a class/field/property/enum name has been renamed during deserialization.

contextProperties PropertyContainer

A dictionary or properties that were generated during deserialization.

Returns

object

An instance of the YAML data.

DeserializeMultiple<T>(Stream)

Deserializes an object from the specified stream (expecting a YAML string).

public IEnumerable<T> DeserializeMultiple<T>(Stream stream)

Parameters

stream Stream

A YAML string from a stream .

Returns

IEnumerable<T>

An instance of the YAML data.

Type Parameters

T

GetSerializerSettings()

Gets the serializer settings.

public SerializerSettings GetSerializerSettings()

Returns

SerializerSettings

SerializerSettings.

ResetCache()

Reset the assembly cache used by this class.

public override void ResetCache()

Serialize(IEmitter, object, Type, SerializerContextSettings)

Serializes an object to specified stream in YAML format.

public void Serialize(IEmitter emitter, object instance, Type type, SerializerContextSettings contextSettings = null)

Parameters

emitter IEmitter

The emitter.

instance object

The object to serialize.

type Type

The type.

contextSettings SerializerContextSettings

The context settings.

Serialize(Stream, object, Type, SerializerContextSettings)

Serializes an object to specified stream in YAML format.

public void Serialize(Stream stream, object instance, Type type = null, SerializerContextSettings contextSettings = null)

Parameters

stream Stream

The stream to receive the YAML representation of the object.

instance object

The instance.

type Type

The expected type.

contextSettings SerializerContextSettings

The context settings.

Events

PrepareMembers

public event Action<ObjectDescriptor, List<IMemberDescriptor>> PrepareMembers

Event Type

Action<ObjectDescriptor, List<IMemberDescriptor>>