I thought about simulating strong-typing for key-value configuration of a new project by providing fake property info via implementing ICustomTypeDescriptor.
The configuration instance should provide all default config keys as properties with default values however: I noticed that VS08 intellisense doesn't include "faked" properties which are created in example similar to
http://zcoder.blogspot.com/2007/11/icustomtypedescriptor.html
Even if I intellisense caches properties information, I used a static instance of the MyCustomClass in another class in a dll and still didn't get intellisense working for it.
Useful Ref ICustomTypeDescriptor, Typ开发者_开发技巧eDescriptionProvider, TypeConverter, and UITypeEditor
ICustomTypeDescriptor
never provides a type-safe interface, so I cannot see how it can ever provide Intellisense.
精彩评论