CollectionWithIdsSerializer Class
Namespace: Stride.Core.Yaml
Assembly: Stride.Core.Assets.dll
System.Object →
Stride.Core.Yaml.Serialization.Serializers.ObjectSerializer →
Stride.Core.Yaml.Serialization.Serializers.DictionarySerializer →
CollectionWithIdsSerializerBase →
CollectionWithIdsSerializer
Derived from CollectionWithIdsSerializer:
[YamlSerializerFactory(new string[]{"Assets"})]
public class CollectionWithIdsSerializer : CollectionWithIdsSerializerBase, IYamlSerializable, IYamlSerializableFactory
|
Improve this Doc
View Source
Methods
CreatEmptyContainer(ITypeDescriptor)
Creates an empty dictionary that can store the mapping of ids to items of the collection.
protected override IDictionary CreatEmptyContainer(ITypeDescriptor descriptor)
Parameters
Type |
Name |
Description |
Stride.Core.Reflection.ITypeDescriptor |
descriptor |
The type descriptor of the collection for which to create the dictionary.
|
Returns
Type |
Description |
System.Collections.IDictionary |
An empty dictionary for mapping ids to elements.
|
Overrides
protected virtual CollectionSerializer GetCollectionSerializerForNonTransformedObject()
Returns
Type |
Description |
Stride.Core.Yaml.Serialization.Serializers.CollectionSerializer |
|
ReadDeletedDictionaryItem(ref ObjectContext, Object)
protected override KeyValuePair<object, object> ReadDeletedDictionaryItem(ref ObjectContext objectContext, object keyResult)
Parameters
Type |
Name |
Description |
Stride.Core.Yaml.Serialization.ObjectContext |
objectContext |
|
System.Object |
keyResult |
|
Returns
Type |
Description |
System.Collections.Generic.KeyValuePair<System.Object, System.Object> |
|
Overrides
ReadYamlAfterTransform(ref ObjectContext, Boolean)
protected override void ReadYamlAfterTransform(ref ObjectContext objectContext, bool transformed)
Parameters
Type |
Name |
Description |
Stride.Core.Yaml.Serialization.ObjectContext |
objectContext |
|
System.Boolean |
transformed |
|
Overrides
Transforms a dictionary containing the mapping of ids to items into the actual collection, and store the ids in the Stride.Core.Reflection.ShadowObject.
protected override void TransformAfterDeserialization(IDictionary container, ITypeDescriptor targetDescriptor, object targetCollection, ICollection<ItemId> deletedItems = null)
Parameters
Type |
Name |
Description |
System.Collections.IDictionary |
container |
The dictionary mapping ids to item.
|
Stride.Core.Reflection.ITypeDescriptor |
targetDescriptor |
The type descriptor of the actual collection to fill.
|
System.Object |
targetCollection |
The instance of the actual collection to fill.
|
System.Collections.Generic.ICollection<ItemId> |
deletedItems |
A collection of items that are marked as deleted. Can be null.
|
Overrides
protected override object TransformForSerialization(ITypeDescriptor descriptor, object collection)
Parameters
Type |
Name |
Description |
Stride.Core.Reflection.ITypeDescriptor |
descriptor |
|
System.Object |
collection |
|
Returns
Type |
Description |
System.Object |
|
Overrides
TransformObjectAfterRead(ref ObjectContext)
protected override void TransformObjectAfterRead(ref ObjectContext objectContext)
Parameters
Type |
Name |
Description |
Stride.Core.Yaml.Serialization.ObjectContext |
objectContext |
|
Overrides
Stride.Core.Yaml.Serialization.Serializers.ObjectSerializer.TransformObjectAfterRead(Stride.Core.Yaml.Serialization.ObjectContext)
TryCreate(SerializerContext, ITypeDescriptor)
public override IYamlSerializable TryCreate(SerializerContext context, ITypeDescriptor typeDescriptor)
Parameters
Type |
Name |
Description |
Stride.Core.Yaml.Serialization.SerializerContext |
context |
|
Stride.Core.Reflection.ITypeDescriptor |
typeDescriptor |
|
Returns
Type |
Description |
Stride.Core.Yaml.Serialization.IYamlSerializable |
|
Overrides
Stride.Core.Yaml.Serialization.Serializers.DictionarySerializer.TryCreate(Stride.Core.Yaml.Serialization.SerializerContext, Stride.Core.Reflection.ITypeDescriptor)
WriteDeletedItems(ref ObjectContext)
protected override void WriteDeletedItems(ref ObjectContext objectContext)
Parameters
Type |
Name |
Description |
Stride.Core.Yaml.Serialization.ObjectContext |
objectContext |
|
Overrides
WriteYamlAfterTransform(ref ObjectContext, Boolean)
protected override void WriteYamlAfterTransform(ref ObjectContext objectContext, bool transformed)
Parameters
Type |
Name |
Description |
Stride.Core.Yaml.Serialization.ObjectContext |
objectContext |
|
System.Boolean |
transformed |
|
Overrides
Stride.Core.Yaml.Serialization.Serializers.DictionarySerializer.ReadMember(Stride.Core.Yaml.Serialization.ObjectContext)
Stride.Core.Yaml.Serialization.Serializers.DictionarySerializer.WriteMembers(Stride.Core.Yaml.Serialization.ObjectContext)
Stride.Core.Yaml.Serialization.Serializers.DictionarySerializer.WriteDictionaryItem(Stride.Core.Yaml.Serialization.ObjectContext, System.Collections.Generic.KeyValuePair<System.Object, System.Object>, System.Collections.Generic.KeyValuePair<System.Type, System.Type>)
Stride.Core.Yaml.Serialization.Serializers.ObjectSerializer.GetStyle(Stride.Core.Yaml.Serialization.ObjectContext)
Stride.Core.Yaml.Serialization.Serializers.ObjectSerializer.ReadMembers<TStart, TEnd>(Stride.Core.Yaml.Serialization.ObjectContext)
Stride.Core.Yaml.Serialization.Serializers.ObjectSerializer.TryReadMember(Stride.Core.Yaml.Serialization.ObjectContext, System.String)
Stride.Core.Yaml.Serialization.Serializers.ObjectSerializer.TryReadMember(Stride.Core.Yaml.Serialization.ObjectContext, Stride.Core.Yaml.Events.Scalar, System.String)
Stride.Core.Yaml.Serialization.Serializers.ObjectSerializer.ReadMemberName(Stride.Core.Yaml.Serialization.ObjectContext, System.String, System.Boolean)
Stride.Core.Yaml.Serialization.Serializers.ObjectSerializer.ReadMemberValue(Stride.Core.Yaml.Serialization.ObjectContext, Stride.Core.Reflection.IMemberDescriptor, System.Object, System.Type)
Stride.Core.Yaml.Serialization.Serializers.ObjectSerializer.WriteMember(Stride.Core.Yaml.Serialization.ObjectContext, Stride.Core.Reflection.IMemberDescriptor)
Stride.Core.Yaml.Serialization.Serializers.ObjectSerializer.WriteMemberName(Stride.Core.Yaml.Serialization.ObjectContext, Stride.Core.Reflection.IMemberDescriptor, System.String)
Stride.Core.Yaml.Serialization.Serializers.ObjectSerializer.WriteMemberValue(Stride.Core.Yaml.Serialization.ObjectContext, Stride.Core.Reflection.IMemberDescriptor, System.Object, System.Type)
Extension Methods