PostSharp 2023.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Formatters Namespace / IOption­Aware­Formatter Interface / IOption­Aware­Formatter Methods / IOption­Aware­Formatter.​With­Options Method

IOptionAwareFormatter.WithOptions Method

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

Namespace:  PostSharp.Patterns.Formatters
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 2023.0.3.0 (2023.0.3.0)
Syntax
C#
IOptionAwareFormatter WithOptions(
	FormattingOptions options
)

Parameters

options
Type: PostSharp.Patterns.Formatters.FormattingOptions
The new options.

Return Value

Type: 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.
See Also