FormatterRepository<TRole> Class |
Allows to get and register formatters for a specific type.
System.Object
PostSharp.Patterns.Formatters.FormatterRepository<TRole>
PostSharp.Patterns.Caching.CachingServices.Formatters
PostSharp.Patterns.Diagnostics.LoggingServices.Formatters
PostSharp.Patterns.Formatters.FormatterRepository<TRole>
PostSharp.Patterns.Caching.CachingServices.Formatters
PostSharp.Patterns.Diagnostics.LoggingServices.Formatters
Namespace: PostSharp.Patterns.Formatters
Assembly: PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 6.9.11.0 (6.9.11.0)
C#
public abstract class FormatterRepository<TRole> where TRole : new(), FormattingRole
Type Parameters
- TRole
- Marker type used to differentiate FormattingServices for different purposes (e.g. caching or logging).
The FormatterRepository<TRole> type exposes the following members.
Name | Description | |
---|---|---|
FormatterRepository<TRole> |
Initializes a new FormatterRepository<TRole>.
|
Name | Description | |
---|---|---|
Get(Type) |
Returns a formatter for a specific object. This overload should be used when the type of the object
is not known at build time because the type is non-sealed.
| |
Get<T>() |
Returns the formatter for the type T.
| |
Register(Type, IFormatter) |
Registers the given formatter for the given targetType.
| |
Register(Type, Type) |
Registers the given formatterType for the given targetType.
| |
Register<T>(IFormatter<T>) |
Registers the given formatter for the type T.
| |
Reset |
Clears formatters, but doesn't reset registrations.
| |
SetDynamic<T> |
Requests that formatters for parameters of a given type will be resolved according
to the type of the parameter value, not to the type of the parameter itself. Interfaces, abstract classes and the Object class are
always resolved dynamically.
|