ContentSerializerBase<T> Class
Namespace: Stride.Core.Serialization.ContentsAssembly: Stride.Core.Serialization.dll
Base class for Content Serializer with empty virtual implementation.
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. |
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. |
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. |