DictionaryWithIdsSerializer Class
Namespace: Stride.Core.YamlAssembly: Stride.Core.Assets.dll
An implementation of CollectionWithIdsSerializerBase for dictionaries.
[YamlSerializerFactory(new string[]{"Assets"})]
public class DictionaryWithIdsSerializer : CollectionWithIdsSerializerBase, IYamlSerializable, IYamlSerializableFactory
Name | Description | |
---|---|---|
Methods | ||
CreatEmptyContainer(ITypeDescriptor) | Creates an empty dictionary that can store the mapping of ids to items of the collection. |
|
ReadDeletedDictionaryItem(ref ObjectContext, Object) | ||
TransformAfterDeserialization(IDictionary, ITypeDescriptor, Object, ICollection<ItemId>) | Transforms a dictionary containing the mapping of ids to items into the actual collection, and store the ids in the Stride.Core.Reflection.ShadowObject. |
|
TransformForSerialization(ITypeDescriptor, Object) | ||
TransformObjectAfterRead(ref ObjectContext) | ||
TryCreate(SerializerContext, ITypeDescriptor) | ||
WriteDeletedItems(ref ObjectContext) |
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
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
TransformAfterDeserialization(IDictionary, ITypeDescriptor, Object, ICollection<ItemId>)
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
TransformForSerialization(ITypeDescriptor, Object)
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
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
WriteDeletedItems(ref ObjectContext)
protected override void WriteDeletedItems(ref ObjectContext objectContext)
Parameters
Type | Name | Description |
---|---|---|
Stride.Core.Yaml.Serialization.ObjectContext | objectContext |