Class AssetYamlSerializer
Default Yaml serializer used to serialize assets by default.
public class AssetYamlSerializer : YamlSerializerBase, IDisposable
- Inheritance
-
YamlSerializerBaseAssetYamlSerializer
- Implements
- Inherited Members
-
YamlSerializerBase.RegisteredAssembliesYamlSerializerBase.LockYamlSerializerBase.Dispose()
- Extension Methods
Properties
Default
public static AssetYamlSerializer Default { get; set; }
Property Value
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
eventReader
EventReaderA YAML event reader.
value
objectThe value.
expectedType
TypeThe expected type.
contextProperties
PropertyContainerA dictionary or properties that were generated during deserialization.
contextSettings
SerializerContextSettingsThe context settings.
Returns
- 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
stream
StreamA YAML string from a stream.
expectedType
TypeThe expected type.
contextSettings
SerializerContextSettingsThe context settings.
Returns
- object
An instance of the YAML data.
Deserialize(Stream, Type, SerializerContextSettings, out bool, 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
stream
StreamA YAML string from a stream .
expectedType
TypeThe expected type.
contextSettings
SerializerContextSettingsThe context settings.
aliasOccurred
boolif set to
true
a class/field/property/enum name has been renamed during deserialization.contextProperties
PropertyContainerA dictionary or properties that were generated during deserialization.
Returns
- 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
stream
StreamA YAML string from a stream .
Returns
- IEnumerable<T>
An instance of the YAML data.
Type Parameters
T
GetSerializerSettings()
Gets the serializer settings.
public SerializerSettings GetSerializerSettings()
Returns
- SerializerSettings
SerializerSettings.
ResetCache()
Reset the assembly cache used by this class.
public override void ResetCache()
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
emitter
IEmitterThe emitter.
instance
objectThe object to serialize.
type
TypeThe type.
contextSettings
SerializerContextSettingsThe 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
stream
StreamThe stream to receive the YAML representation of the object.
instance
objectThe instance.
type
TypeThe expected type.
contextSettings
SerializerContextSettingsThe context settings.
Events
PrepareMembers
public event Action<ObjectDescriptor, List<IMemberDescriptor>> PrepareMembers