ZeroFormatter
ZeroFormatter copied to clipboard
Add explicit formatter declaration for ZeroFormattable attribute
- add tests
- add checks in analyzer
I find it rather complicated having to register the formatters one after one. First, advanced logic is needed to register all resolvers from all referenced libraries (were should that code be put?) and it's uneconomical to keep track of all needed resolvers in a huge repository. I implemented a behavior like Json.Net and XmlSerializer are using: Every type knows it's formatter which is just used instead of resolving one (if it's set). The registering still has it's use when dealing with external types, but for custom types the FormatterType is a huge advantage.