var t = cls_type.GetNestedType("declf"); Assert.Equal(t.BaseType, typeof(MulticastDelegate));
同时他还具备了4个方法,其中一个是构造方法,以及三个重写的方法.
通过检查他的il我们可以发现declf就是个class,所以事情就简化成了构造这个类的问题.:
.classprivate auto ansi '<Module>' { } // end of class <Module>
.classpublic auto ansi beforefieldinit CustomType extends [mscorlib]System.Object { // Nested Types .class nested public auto ansi sealed declf extends [mscorlib]System.MulticastDelegate { // Methods .method public hidebysig specialname rtspecialname instance void .ctor ( object'object', native int'method' ) runtime managed { } // end of method declf::.ctor
.method public hidebysig newslot virtual instance float32 Invoke ( float32 x, float32 y ) runtime managed { } // end of method declf::Invoke
.method public hidebysig newslot virtual instance class [mscorlib]System.IAsyncResultBeginInvoke ( float32x, float32y, class [mscorlib]System.AsyncCallbackcallback, object 'object' ) runtimemanaged { } // end of method declf::BeginInvoke
.method public hidebysig newslot virtual instance float32 EndInvoke ( class [mscorlib]System.IAsyncResult result ) runtime managed { } // end of method declf::EndInvoke