Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    SerializerSelector Class

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

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

    System.Object → SerializerSelector
    Derived from SerializerSelector:

    public class SerializerSelector
    Name Description
    Constructors
    SerializerSelector(Boolean, Boolean, String[])

    Initializes a new instance of the SerializerSelector class.

    SerializerSelector(String[])
    Fields
    SelectorOverride
    Properties
    Asset
    AssetWithReuse
    Default

    Gets the default instance of Serializer.

    ExternalIdentifiableAsGuid

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

    Profiles
    ReuseReferences

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

    SerializerFactories
    Methods
    EnsureInitialized(DataSerializer)

    Internal function, for use by SerializerFactory.

    GetSerializer(ref ObjectId)
    GetSerializer(Type)

    Gets the serializer.

    GetSerializer<T>()

    Gets the serializer.

    HasProfile(String)

    Checks if this instance supports the specified serialization profile.

    | Improve this Doc View Source

    Constructors


    SerializerSelector(Boolean, Boolean, String[])

    Initializes a new instance of the SerializerSelector class.

    public SerializerSelector(bool reuseReferences, bool externalIdentifiableAsGuid, params string[] profiles)
    Parameters
    Type Name Description
    System.Boolean reuseReferences

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

    System.Boolean externalIdentifiableAsGuid
    System.String[] profiles

    The profiles.


    SerializerSelector(String[])

    public SerializerSelector(params string[] profiles)
    Parameters
    Type Name Description
    System.String[] profiles
    | Improve this Doc View Source

    Fields


    SelectorOverride

    public SerializerSelector SelectorOverride
    Field Value
    Type Description
    SerializerSelector
    | Improve this Doc View Source

    Properties


    Asset

    public static SerializerSelector Asset { get; }
    Property Value
    Type Description
    SerializerSelector

    AssetWithReuse

    public static SerializerSelector AssetWithReuse { get; }
    Property Value
    Type Description
    SerializerSelector

    Default

    Gets the default instance of Serializer.

    public static SerializerSelector Default { get; }
    Property Value
    Type Description
    SerializerSelector

    The default instance.


    ExternalIdentifiableAsGuid

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

    public bool ExternalIdentifiableAsGuid { get; }
    Property Value
    Type Description
    System.Boolean

    Profiles

    public IEnumerable<string> Profiles { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<System.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
    Type Description
    System.Boolean

    SerializerFactories

    public List<SerializerFactory> SerializerFactories { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<SerializerFactory>
    | Improve this Doc View Source

    Methods


    EnsureInitialized(DataSerializer)

    Internal function, for use by SerializerFactory.

    public void EnsureInitialized(DataSerializer dataSerializer)
    Parameters
    Type Name Description
    DataSerializer dataSerializer

    The data serializer to initialize if not done yet


    GetSerializer(ref ObjectId)

    public DataSerializer GetSerializer(ref ObjectId typeId)
    Parameters
    Type Name Description
    ObjectId typeId
    Returns
    Type Description
    DataSerializer

    GetSerializer(Type)

    Gets the serializer.

    public DataSerializer GetSerializer(Type type)
    Parameters
    Type Name Description
    System.Type type

    The type that you want to (de)serialize.

    Returns
    Type Description
    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
    Type Description
    DataSerializer<T>

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

    Type Parameters
    Name Description
    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
    Type Name Description
    System.String profile

    Name of the profile

    Returns
    Type Description
    System.Boolean

    true if this instance supports the specified serialization profile


    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