Table of Contents

Class AssetObjectSerializerBackend

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

Internal class used when serializing/deserializing an object.

public class AssetObjectSerializerBackend : DefaultObjectSerializerBackend, IObjectSerializerBackend
Inheritance
DefaultObjectSerializerBackend
AssetObjectSerializerBackend
Implements
IObjectSerializerBackend
Inherited Members
DefaultObjectSerializerBackend.GetStyle(ref ObjectContext)
DefaultObjectSerializerBackend.ReadYaml(ref ObjectContext)
DefaultObjectSerializerBackend.WriteYaml(ref ObjectContext)

Constructors

AssetObjectSerializerBackend(ITypeDescriptorFactory)

public AssetObjectSerializerBackend(ITypeDescriptorFactory typeDescriptorFactory)

Parameters

typeDescriptorFactory ITypeDescriptorFactory

Fields

ObjectReferencesKey

public static readonly PropertyKey<YamlAssetMetadata<Guid>> ObjectReferencesKey

Field Value

PropertyKey<YamlAssetMetadata<Guid>>

OverrideDictionaryKey

public static readonly PropertyKey<YamlAssetMetadata<OverrideType>> OverrideDictionaryKey

Field Value

PropertyKey<YamlAssetMetadata<OverrideType>>

Methods

GetCurrentPath(ref ObjectContext, bool)

public static YamlAssetPath GetCurrentPath(ref ObjectContext objectContext, bool clone)

Parameters

objectContext ObjectContext
clone bool

Returns

YamlAssetPath

ReadCollectionItem(ref ObjectContext, object, Type, int)

Reads the collection item from the current YAML stream.

public override object ReadCollectionItem(ref ObjectContext objectContext, object value, Type itemType, int index)

Parameters

objectContext ObjectContext

The object context.

value object

The value.

itemType Type

Type of the item.

index int

Returns

object

The collection item read from YAML stream.

ReadDictionaryKey(ref ObjectContext, Type)

Reads the key of the dictionary item from the current YAML stream.

public override object ReadDictionaryKey(ref ObjectContext objectContext, Type keyType)

Parameters

objectContext ObjectContext

The object context.

keyType Type

Type of the key.

Returns

object

The key of the dictionary item read from YAML stream.

ReadDictionaryValue(ref ObjectContext, Type, object)

Reads the value of the dictionary item from the current YAML stream.

public override object ReadDictionaryValue(ref ObjectContext objectContext, Type valueType, object key)

Parameters

objectContext ObjectContext

The object context.

valueType Type

Type of the value.

key object

The key corresponding to the value.

Returns

object

The value of the dictionary item read from YAML stream.

ReadMemberName(ref ObjectContext, string, out bool)

Allows to transform the name of the member while reading for the specified object context.

public override string ReadMemberName(ref ObjectContext objectContext, string memberName, out bool skipMember)

Parameters

objectContext ObjectContext

The object context to which the member name.

memberName string

Name of the member read from the current yaml stream.

skipMember bool

Returns

string

The name that will be used to get the Stride.Core.Reflection.IMemberDescriptor from the current object context.

ReadMemberValue(ref ObjectContext, IMemberDescriptor, object, Type)

Reads the value for the specified member from the current YAML stream.

public override object ReadMemberValue(ref ObjectContext objectContext, IMemberDescriptor memberDescriptor, object memberValue, Type memberType)

Parameters

objectContext ObjectContext

The object context.

memberDescriptor IMemberDescriptor
memberValue object

The member value. See remarks

memberType Type

Type of the member.

Returns

object

The value read from YAML stream.

Remarks

TODO: Explain memberValue when can be not null

ShouldSerialize(IMemberDescriptor, ref ObjectContext)

Indicates if the given member should be serialized.

public override bool ShouldSerialize(IMemberDescriptor member, ref ObjectContext objectContext)

Parameters

member IMemberDescriptor

The member to evaluate.

objectContext ObjectContext

The object context.

Returns

bool

True if the member should be serialized, False otherwise.

WriteCollectionItem(ref ObjectContext, object, Type, int)

Writes the collection item.

public override void WriteCollectionItem(ref ObjectContext objectContext, object item, Type itemType, int index)

Parameters

objectContext ObjectContext

The object context.

item object

The item.

itemType Type

Type of the item.

index int

WriteDictionaryKey(ref ObjectContext, object, Type)

Writes the key of the dictionary item.

public override void WriteDictionaryKey(ref ObjectContext objectContext, object key, Type keyType)

Parameters

objectContext ObjectContext

The object context.

key object

The key of the dictionary item.

keyType Type

Type of the key.

WriteDictionaryValue(ref ObjectContext, object, object, Type)

Writes the value of the dictionary item.

public override void WriteDictionaryValue(ref ObjectContext objectContext, object key, object value, Type valueType)

Parameters

objectContext ObjectContext

The object context.

key object
value object

The value of the dictionary item.

valueType Type

Type of the value.

WriteMemberName(ref ObjectContext, IMemberDescriptor, string)

Writes the name of the member.

public override void WriteMemberName(ref ObjectContext objectContext, IMemberDescriptor member, string memberName)

Parameters

objectContext ObjectContext

The object context.

member IMemberDescriptor

The member.

memberName string

Name of the member.

WriteMemberValue(ref ObjectContext, IMemberDescriptor, object, Type)

Writes the member value.

public override void WriteMemberValue(ref ObjectContext objectContext, IMemberDescriptor memberDescriptor, object memberValue, Type memberType)

Parameters

objectContext ObjectContext

The object context.

memberDescriptor IMemberDescriptor
memberValue object

The member value.

memberType Type

Type of the member.