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
eventReaderEventReaderA YAML event reader.
valueobjectThe value.
expectedTypeTypeThe expected type.
contextPropertiesPropertyContainerA dictionary or properties that were generated during deserialization.
contextSettingsSerializerContextSettingsThe 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
streamStreamA YAML string from a stream.
expectedTypeTypeThe expected type.
contextSettingsSerializerContextSettingsThe 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
streamStreamA YAML string from a stream .
expectedTypeTypeThe expected type.
contextSettingsSerializerContextSettingsThe context settings.
aliasOccurredboolif set to
truea class/field/property/enum name has been renamed during deserialization.contextPropertiesPropertyContainerA 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
streamStreamA 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
emitterIEmitterThe emitter.
instanceobjectThe object to serialize.
typeTypeThe type.
contextSettingsSerializerContextSettingsThe 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
streamStreamThe stream to receive the YAML representation of the object.
instanceobjectThe instance.
typeTypeThe expected type.
contextSettingsSerializerContextSettingsThe context settings.
Events
PrepareMembers
public event Action<ObjectDescriptor, List<IMemberDescriptor>> PrepareMembers