Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    AssetYamlSerializer Class

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

    Default Yaml serializer used to serialize assets by default.

    System.Object → Stride.Core.Yaml.YamlSerializerBase → AssetYamlSerializer
    Derived from AssetYamlSerializer:

    public class AssetYamlSerializer : YamlSerializerBase, IDisposable
    Name Description
    Properties
    Default
    Methods
    Deserialize(EventReader, Object, Type, out PropertyContainer, SerializerContextSettings)

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

    Deserialize(Stream, Type, SerializerContextSettings)

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

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

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

    DeserializeMultiple<T>(Stream)

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

    GetSerializerSettings()

    Gets the serializer settings.

    ResetCache()

    Reset the assembly cache used by this class.

    Serialize(IEmitter, Object, Type, SerializerContextSettings)

    Serializes an object to specified stream in YAML format.

    Serialize(Stream, Object, Type, SerializerContextSettings)

    Serializes an object to specified stream in YAML format.

    Events
    PrepareMembers
    | Improve this Doc View Source

    Properties


    Default

    public static AssetYamlSerializer Default { get; set; }
    Property Value
    Type Description
    AssetYamlSerializer
    | Improve this Doc View Source

    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
    Type Name Description
    Stride.Core.Yaml.EventReader eventReader

    A YAML event reader.

    System.Object value

    The value.

    System.Type expectedType

    The expected type.

    PropertyContainer contextProperties

    A dictionary or properties that were generated during deserialization.

    Stride.Core.Yaml.Serialization.SerializerContextSettings contextSettings

    The context settings.

    Returns
    Type Description
    System.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
    Type Name Description
    System.IO.Stream stream

    A YAML string from a stream.

    System.Type expectedType

    The expected type.

    Stride.Core.Yaml.Serialization.SerializerContextSettings contextSettings

    The context settings.

    Returns
    Type Description
    System.Object

    An instance of the YAML data.


    Deserialize(Stream, Type, SerializerContextSettings, out Boolean, 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
    Type Name Description
    System.IO.Stream stream

    A YAML string from a stream .

    System.Type expectedType

    The expected type.

    Stride.Core.Yaml.Serialization.SerializerContextSettings contextSettings

    The context settings.

    System.Boolean aliasOccurred

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

    PropertyContainer contextProperties

    A dictionary or properties that were generated during deserialization.

    Returns
    Type Description
    System.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
    Type Name Description
    System.IO.Stream stream

    A YAML string from a stream .

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T>

    An instance of the YAML data.

    Type Parameters
    Name Description
    T

    GetSerializerSettings()

    Gets the serializer settings.

    public SerializerSettings GetSerializerSettings()
    Returns
    Type Description
    Stride.Core.Yaml.Serialization.SerializerSettings

    SerializerSettings.


    ResetCache()

    Reset the assembly cache used by this class.

    public override void ResetCache()
    Overrides
    Stride.Core.Yaml.YamlSerializerBase.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
    Type Name Description
    Stride.Core.Yaml.IEmitter emitter

    The emitter.

    System.Object instance

    The object to serialize.

    System.Type type

    The type.

    Stride.Core.Yaml.Serialization.SerializerContextSettings contextSettings

    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
    Type Name Description
    System.IO.Stream stream

    The stream to receive the YAML representation of the object.

    System.Object instance

    The instance.

    System.Type type

    The expected type.

    Stride.Core.Yaml.Serialization.SerializerContextSettings contextSettings

    The context settings.

    | Improve this Doc View Source

    Events


    PrepareMembers

    public event Action<ObjectDescriptor, List<IMemberDescriptor>> PrepareMembers
    Event Type
    Type Description
    System.Action<Stride.Core.Reflection.ObjectDescriptor, System.Collections.Generic.List<Stride.Core.Reflection.IMemberDescriptor>>

    Inherited Members

    Stride.Core.Yaml.YamlSerializerBase.RegisteredAssemblies
    Stride.Core.Yaml.YamlSerializerBase.Lock
    Stride.Core.Yaml.YamlSerializerBase.Dispose()

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation