PostSharp 6.10 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Formatters Namespace / Formatter­Extensions Class / Formatter­Extensions Methods / Formatter­Extensions.​With­Options Method / Formatter­Extensions.​With­Options(T) Method (IFormatter(T), Formatting­Options)

FormatterExtensions.WithOptions<T> Method (IFormatter<T>, FormattingOptions)

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: 6.10.14.0 (6.10.14.0)
Syntax
C#
public static IFormatter<T> WithOptions<T>(
	this IFormatter<T> formatter,
	FormattingOptions options
)

Parameters

formatter
Type: PostSharp.Patterns.Formatters.IFormatter<T>
The original formatter.
options
Type: PostSharp.Patterns.Formatters.FormattingOptions
The new options.

Type Parameters

T

Return Value

Type: IFormatter<T>
A copy of the current formatter with the new options.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IFormatter<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also