Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    ContentSerializerBase<T> Class

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

    Base class for Content Serializer with empty virtual implementation.

    System.Object → ContentSerializerBase<T>
    Derived from ContentSerializerBase<T>: DataContentSerializer<T>

    public class ContentSerializerBase<T> : IContentSerializer<T>, IContentSerializer
    Type Parameters
    Name Description
    T

    Runtime type being serialized.

    Name Description
    Properties
    ActualType

    Gets the actual runtime type of object being serialized by Serialize(ContentSerializerContext, SerializationStream, Object). It could be different than SerializationType if a conversion happened.

    SerializationType

    Gets the type stored on HDD. Usually matches ActualType, but sometimes it might be converted to a different format (i.e. a GPU Texture is saved as an Image).

    Methods
    Construct(ContentSerializerContext)

    Constructs the specified object. This is useful if there is any cycle in the object graph reference.

    Serialize(ContentSerializerContext, SerializationStream, T)
    Serialize(ContentSerializerContext, SerializationStream, Object)

    Serializes the specified object.

    | Improve this Doc View Source

    Properties


    ActualType

    Gets the actual runtime type of object being serialized by Serialize(ContentSerializerContext, SerializationStream, Object). It could be different than SerializationType if a conversion happened.

    public virtual Type ActualType { get; }
    Property Value
    Type Description
    System.Type

    The actual type.


    SerializationType

    Gets the type stored on HDD. Usually matches ActualType, but sometimes it might be converted to a different format (i.e. a GPU Texture is saved as an Image).

    public virtual Type SerializationType { get; }
    Property Value
    Type Description
    System.Type

    The type stored on HDD.

    | Improve this Doc View Source

    Methods


    Construct(ContentSerializerContext)

    Constructs the specified object. This is useful if there is any cycle in the object graph reference.

    public virtual object Construct(ContentSerializerContext context)
    Parameters
    Type Name Description
    ContentSerializerContext context

    The context.

    Returns
    Type Description
    System.Object

    The newly built object.


    Serialize(ContentSerializerContext, SerializationStream, T)

    public virtual void Serialize(ContentSerializerContext context, SerializationStream stream, T obj)
    Parameters
    Type Name Description
    ContentSerializerContext context
    SerializationStream stream
    T obj

    Serialize(ContentSerializerContext, SerializationStream, Object)

    Serializes the specified object.

    public void Serialize(ContentSerializerContext context, SerializationStream stream, object obj)
    Parameters
    Type Name Description
    ContentSerializerContext context

    The context.

    SerializationStream stream

    The stream.

    System.Object obj

    The object.


    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