02 2014 档案
4.5你太黑了,不带这么玩TypeForwardedTo的
摘要:话说最近好不容易把framework 4.0的metadata信息都能全部抽出了,结果换4.5挂了。。。framework那帮人在4.5里面用了些什么诡异的玩意?结果一看4.5的部分field用了typed function pointer这个诡异的类型,好吧,还好之前留好空挡了,就等有空的时候去填空,现在就乖乖的补上实现,最多麻烦点,field signature里面放个类型,类型里面可以选typed function pointer,typed function pointer里面有个method signature,method signature里面继续有类型,当然类型里面要是他们高兴
阅读全文
一个非常简单的反射加速方案
摘要:不废话,直接上代码: class Program { private static readonly MethodInfo HelpMethod = typeof(Program).GetMethod("GetHelp", BindingFlags.NonPublic | BindingFlags.Static); static void Main(string[] args) { // you can cache the delegate, the type of delegate is always Func ...
阅读全文