开发者

Framework for .net Reflection.Emit simplification?

Is there a framework, that makes the use of of Reflection.Emit easier? Something I can tell: Give me a class with a string field and get,s开发者_C百科et accessors.

The code I find in Create a class type in code in .net c# is what I need, but it is somewhat cryptic. I think a library with a simplified interface would boost productivity.


I think you just described CodeDOM. Unfortunately, it doesn't really (IMO) make it easier - it just makes it... different.

Personally, I'd just use TypeBuilder, ILGenerator and encapsulate the common functionality I need, i.e.

PropertyBuilder CreateProperty(TypeBuilder type, string name, Type propertyType)
{...}

Meta-programming is rarely simple, but from that detail you get a very good understanding of what is actually happening.


Have a look at the CCI.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜