Open sandboxFocus

Method WithOptions

WithOptions(FormattingOptions)

Returns a copy of the current formatter, but for different options.

Declaration
IOptionAwareFormatter WithOptions(FormattingOptions options)
Parameters
Type Name Description
FormattingOptions options

The new options.

Returns
Type Description
IOptionAwareFormatter

A copy of the current formatter with the new options.

Remarks

It is essential for performance that the implementation respects a semi-singleton pattern, i.e. to keep a single instance of the formatter for each single distinct value of FormattingOptions.