YamlStringStyleAttribute Class
Overrides the style used to emit the string values written by the attributed member.
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
public sealed class YamlStringStyleAttribute : YamlAttributeRemarks
Apply this attribute to a property or field whose value is a string or contains strings. The override is scoped to the serialization of that member value and affects the strings encountered below it, which includes the items of a collection and the values of a nested object. It does not affect mapping keys. See YamlScalarStylePreferences.StringStyle.
- Inheritance
YamlAttributeYamlStringStyleAttribute
Constructors
| Name | Description |
|---|---|
| YamlStringStyleAttribute(ScalarStyle) | Initializes a new instance of the YamlStringStyleAttribute class. |
YamlStringStyleAttribute(ScalarStyle)
YamlStringStyleAttribute.csInitializes a new instance of the YamlStringStyleAttribute class.
public YamlStringStyleAttribute(ScalarStyle style)Parameters
styleScalarStyle- The style to use for string values.
Exceptions
ArgumentOutOfRangeExceptionstyleis not a definedScalarStyle.
Properties
| Name | Description |
|---|---|
| Style | Gets the style to use for string values. |