Table of Contents

Class YamlSerializerOptions

Namespace
Cuemon.Runtime.Serialization
Assembly
Cuemon.Core.dll

Configuration options for YamlSerializer.

public class YamlSerializerOptions : EncodingOptions, IEncodingOptions, IValidatableParameterObject, IParameterObject
Inheritance
Object
YamlSerializerOptions
Implements
Inherited Members

Constructors

YamlSerializerOptions()

Initializes a new instance of the YamlSerializerOptions class.

public YamlSerializerOptions()

Remarks

The following table shows the initial property values for an instance of YamlSerializerOptions.

PropertyInitial Value
ConvertersSystem.Collections.Generic.List<T>
WhiteSpaceIndentation2
NamingPolicynull

Properties

Converters

Gets a YamlConverter collection that will be used during serialization.

public IList<YamlConverter> Converters { get; set; }

Property Value

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.

public YamlNamingPolicy NamingPolicy { get; set; }

Property Value

YamlNamingPolicy

A property naming policy, or null to leave property names unchanged.

ReflectionRules

Gets or sets the binding constraints for reflection based member searching.

public MemberReflection ReflectionRules { get; set; }

Property Value

MemberReflection

The binding constraints for reflection based member searching.

Exceptions

System.ArgumentNullException

value cannot be null.

WhiteSpaceIndentation

Gets or sets the white space indentation.

public int WhiteSpaceIndentation { get; set; }

Property Value

Int32

The white space indentation.

Methods

SetPropertyName(String)

Returns the specified name adhering to the underlying NamingPolicy.

public string SetPropertyName(string name)

Parameters

name String

The name of the property.

Returns

String

When NamingPolicy is null, the specified name is returned unaltered; otherwise it is converted according to the NamingPolicy.

ValidateOptions()

Determines whether the public read-write properties of this instance are in a valid state.

public void ValidateOptions()

Remarks

This method is expected to throw exceptions when one or more conditions fails to be in a valid state.

Exceptions

System.InvalidOperationException

Converters cannot be null - or -, ReflectionRules cannot be null.