AssetYamlSerializer Class
Namespace: Stride.Core.YamlAssembly: Stride.Core.Assets.dll
Default Yaml serializer used to serialize assets by default.
public class AssetYamlSerializer : YamlSerializerBase, IDisposable
Name | Description | |
---|---|---|
Properties | ||
Default | ||
Methods | ||
Deserialize(EventReader, Object, Type, out PropertyContainer, SerializerContextSettings) | Deserializes an object from the specified stream (expecting a YAML string). |
|
Deserialize(Stream, Type, SerializerContextSettings) | Deserializes an object from the specified stream (expecting a YAML string). |
|
Deserialize(Stream, Type, SerializerContextSettings, out Boolean, out PropertyContainer) | Deserializes an object from the specified stream (expecting a YAML string). |
|
DeserializeMultiple<T>(Stream) | Deserializes an object from the specified stream (expecting a YAML string). |
|
GetSerializerSettings() | Gets the serializer settings. |
|
ResetCache() | Reset the assembly cache used by this class. |
|
Serialize(IEmitter, Object, Type, SerializerContextSettings) | Serializes an object to specified stream in YAML format. |
|
Serialize(Stream, Object, Type, SerializerContextSettings) | Serializes an object to specified stream in YAML format. |
|
Events | ||
PrepareMembers |
Properties
Default
public static AssetYamlSerializer Default { get; set; }
Property Value
Type | Description |
---|---|
AssetYamlSerializer |
Methods
Deserialize(EventReader, Object, Type, out PropertyContainer, SerializerContextSettings)
Deserializes an object from the specified stream (expecting a YAML string).
public object Deserialize(EventReader eventReader, object value, Type expectedType, out PropertyContainer contextProperties, SerializerContextSettings contextSettings = null)
Parameters
Type | Name | Description |
---|---|---|
Stride.Core.Yaml.EventReader | eventReader | A YAML event reader. |
System.Object | value | The value. |
System.Type | expectedType | The expected type. |
PropertyContainer | contextProperties | A dictionary or properties that were generated during deserialization. |
Stride.Core.Yaml.Serialization.SerializerContextSettings | contextSettings | The context settings. |
Returns
Type | Description |
---|---|
System.Object | An instance of the YAML data. |
Deserialize(Stream, Type, SerializerContextSettings)
Deserializes an object from the specified stream (expecting a YAML string).
public object Deserialize(Stream stream, Type expectedType = null, SerializerContextSettings contextSettings = null)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | A YAML string from a stream. |
System.Type | expectedType | The expected type. |
Stride.Core.Yaml.Serialization.SerializerContextSettings | contextSettings | The context settings. |
Returns
Type | Description |
---|---|
System.Object | An instance of the YAML data. |
Deserialize(Stream, Type, SerializerContextSettings, out Boolean, out PropertyContainer)
Deserializes an object from the specified stream (expecting a YAML string).
public object Deserialize(Stream stream, Type expectedType, SerializerContextSettings contextSettings, out bool aliasOccurred, out PropertyContainer contextProperties)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | A YAML string from a stream . |
System.Type | expectedType | The expected type. |
Stride.Core.Yaml.Serialization.SerializerContextSettings | contextSettings | The context settings. |
System.Boolean | aliasOccurred | if set to |
PropertyContainer | contextProperties | A dictionary or properties that were generated during deserialization. |
Returns
Type | Description |
---|---|
System.Object | An instance of the YAML data. |
DeserializeMultiple<T>(Stream)
Deserializes an object from the specified stream (expecting a YAML string).
public IEnumerable<T> DeserializeMultiple<T>(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | A YAML string from a stream . |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | An instance of the YAML data. |
Type Parameters
Name | Description |
---|---|
T |
GetSerializerSettings()
Gets the serializer settings.
public SerializerSettings GetSerializerSettings()
Returns
Type | Description |
---|---|
Stride.Core.Yaml.Serialization.SerializerSettings | SerializerSettings. |
ResetCache()
Reset the assembly cache used by this class.
public override void ResetCache()
Overrides
Serialize(IEmitter, Object, Type, SerializerContextSettings)
Serializes an object to specified stream in YAML format.
public void Serialize(IEmitter emitter, object instance, Type type, SerializerContextSettings contextSettings = null)
Parameters
Type | Name | Description |
---|---|---|
Stride.Core.Yaml.IEmitter | emitter | The emitter. |
System.Object | instance | The object to serialize. |
System.Type | type | The type. |
Stride.Core.Yaml.Serialization.SerializerContextSettings | contextSettings | The context settings. |
Serialize(Stream, Object, Type, SerializerContextSettings)
Serializes an object to specified stream in YAML format.
public void Serialize(Stream stream, object instance, Type type = null, SerializerContextSettings contextSettings = null)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to receive the YAML representation of the object. |
System.Object | instance | The instance. |
System.Type | type | The expected type. |
Stride.Core.Yaml.Serialization.SerializerContextSettings | contextSettings | The context settings. |
Events
PrepareMembers
public event Action<ObjectDescriptor, List<IMemberDescriptor>> PrepareMembers
Event Type
Type | Description |
---|---|
System.Action<Stride.Core.Reflection.ObjectDescriptor, System.Collections.Generic.List<Stride.Core.Reflection.IMemberDescriptor>> |