PostSharp 6.10 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Formatters Namespace / Formatter­Repository(TRole) Class / Formatter­Repository(TRole) Methods / Formatter­Repository(TRole).​Register Method / Formatter­Repository(TRole).​Register Method (Type, IFormatter)

FormatterRepository<TRole>.Register Method (Type, IFormatter)

Registers the given formatter for the given targetType.

Namespace:  PostSharp.Patterns.Formatters
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 6.10.5.0 (6.10.5.0)
Syntax
C#
public static void Register(
	Type targetType,
	IFormatter formatter
)

Parameters

targetType
Type: System.Type
formatter
Type: PostSharp.Patterns.Formatters.IFormatter
Remarks
The formatter will work for the given target type, and also for any type that inherits/implements the target type.
See Also