开发者

ICustomTypeDescriptor for simulating strong-typing

开发者 https://www.devze.com 2022-12-18 11:16 出处:网络
I thought about simulating strong-typing for key-value configuration of a new project by providing fake property info via implementing ICustomTypeDescriptor.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号