Class YamlSerializerOptions
Configuration options for YamlSerializer.
Inherited Members
Namespace: Cuemon.Runtime.Serialization
Assembly: Cuemon.Core.dll
Syntax
public class YamlSerializerOptions : EncodingOptions, IEncodingOptions, IValidatableParameterObject, IParameterObject
Constructors
| Improve this Doc View SourceYamlSerializerOptions()
Initializes a new instance of the YamlSerializerOptions class.
Declaration
public YamlSerializerOptions()
Remarks
The following table shows the initial property values for an instance of YamlSerializerOptions.
Property | Initial Value |
---|---|
Converters | List<T> |
WhiteSpaceIndentation | 2 |
NamingPolicy | null |
Properties
| Improve this Doc View SourceConverters
Gets a YamlConverter collection that will be used during serialization.
Declaration
public IList<YamlConverter> Converters { get; set; }
Property Value
Type | Description |
---|---|
IList<YamlConverter> | The converters that will be used during serialization. |
NamingPolicy
Gets or sets a value that specifies the policy used to convert a property's name on an object to another format, or null to leave property names unchanged.
Declaration
public YamlNamingPolicy NamingPolicy { get; set; }
Property Value
Type | Description |
---|---|
YamlNamingPolicy | A property naming policy, or null to leave property names unchanged. |
ReflectionRules
Gets or sets the binding constraints for reflection based member searching.
Declaration
public MemberReflection ReflectionRules { get; set; }
Property Value
Type | Description |
---|---|
MemberReflection | The binding constraints for reflection based member searching. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
WhiteSpaceIndentation
Gets or sets the white space indentation.
Declaration
public int WhiteSpaceIndentation { get; set; }
Property Value
Type | Description |
---|---|
Int32 | The white space indentation. |
Methods
| Improve this Doc View SourceSetPropertyName(String)
Returns the specified name
adhering to the underlying NamingPolicy.
Declaration
public string SetPropertyName(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the property. |
Returns
Type | Description |
---|---|
String | When NamingPolicy is null, the specified |
ValidateOptions()
Determines whether the public read-write properties of this instance are in a valid state.
Declaration
public void ValidateOptions()
Remarks
This method is expected to throw exceptions when one or more conditions fails to be in a valid state.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Converters cannot be null - or -, ReflectionRules cannot be null. |