FormatOptions Class

Provides the text format options.

C#
public sealed class FormatOptions
Inheritance
FormatOptions

Constructors

FormatOptions(int, string)

Initializes a new instance of the FormatOptions class.

Fields

DefaultIndent

Represents the default indentation, where the indent width is two and the new line is platform-dependent.

Properties

IndentWidth

Gets the indent width.

NewLine

Gets the string representing a new line.

Methods

Equals(object) (Inherited from object)
GetHashCode() (Inherited from object)
GetType() (Inherited from object)
MemberwiseClone() (Inherited from object)
ToString() (Inherited from object)

Constructors Detail

FormatOptions(int, string)

Initializes a new instance of the FormatOptions class.

C#
public FormatOptions([int indentWidth = 2], [string newLine = null])

Parameters

indentWidth
int

The indent width, which must be greater than or equal to 0, and must not be greater than eight.

newLine
string

The string representing a new line. null means Environment.NewLine.

Fields Detail

DefaultIndent

Represents the default indentation, where the indent width is two and the new line is platform-dependent.

C#
public static readonly FormatOptions DefaultIndent

Field Value

Properties Detail

IndentWidth

Gets the indent width.

C#
public int IndentWidth { get; }

Property Value

int

NewLine

Gets the string representing a new line.

C#
public string NewLine { get; }

Property Value