PostSharp 6.6 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Formatters Namespace / Formatter­Repository(TRole) Class / Formatter­Repository(TRole) Methods

FormatterRepository<TRole> Methods

The FormatterRepository<TRole> generic type exposes the following members.

Methods
  NameDescription
Public methodStatic memberGet(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.
Public methodStatic memberGet<T>()
Returns the formatter for the type T.
Public methodStatic memberRegister(Type, IFormatter)
Registers the given formatter for the given targetType.
Public methodStatic memberCode exampleRegister(Type, Type)
Registers the given formatterType for the given targetType.
Public methodStatic memberRegister<T>(IFormatter<T>)
Registers the given formatter for the type T.
Public methodStatic memberReset
Clears formatters, but doesn't reset registrations.
Public methodStatic memberSetDynamic<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.
See Also