TomlStringStyleAttribute Class

Overrides string formatting for a string member.

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
public sealed class TomlStringStyleAttribute : TomlAttribute
Inheritance
TomlAttribute TomlStringStyleAttribute

Constructors

NameDescription
TomlStringStyleAttribute(TomlStringStyle)Initializes a new instance of the TomlStringStyleAttribute class.

TomlStringStyleAttribute(TomlStringStyle)

TomlStringStyleAttribute.cs

Initializes a new instance of the TomlStringStyleAttribute class.

public TomlStringStyleAttribute(TomlStringStyle style)

Parameters

style TomlStringStyle
The preferred string style.

Properties

NameDescription
AllowHexEscapesGets or sets whether control characters up to U+00FF are escaped with the TOML 1.1 \xHH and \e escapes instead of \uXXXX.
PreferLiteralWhenNoEscapesGets or sets whether literal strings should be preferred when no escaping is required.
StyleGets the preferred string style.

Gets or sets whether control characters up to U+00FF are escaped with the TOML 1.1 \xHH and \e escapes instead of \uXXXX.

public TomlBooleanPreference AllowHexEscapes { get; set; }

Property value

TomlBooleanPreference

Exceptions

ArgumentOutOfRangeException
Value is not a defined TomlBooleanPreference.

PreferLiteralWhenNoEscapes

TomlStringStyleAttribute.cs

Gets or sets whether literal strings should be preferred when no escaping is required.

public TomlBooleanPreference PreferLiteralWhenNoEscapes { get; set; }

Property value

TomlBooleanPreference

Exceptions

ArgumentOutOfRangeException
Value is not a defined TomlBooleanPreference.

Gets the preferred string style.

public TomlStringStyle Style { get; }

Property value

TomlStringStyle