protected new PERWAPI.MethodDef GenerateClassForMethod(CodeGenContext context) { // public class Eval: IEval { evalClass = context.CreateGlobalClass("_Internal", "Eval", Runtime.SystemObjectRef); evalClass.AddImplementedInterface(Runtime.IEvalRef); if (context.CurrentRubyClass == null) { context.CurrentRubyClass = CodeGenContext.AddField(evalClass, PERWAPI.FieldAttr.PublicStatic, "myRubyClass", Runtime.ClassRef); CodeGenContext cctor = context.CreateStaticConstructor(evalClass); cctor.ldsfld(Runtime.Init.rb_cObject); cctor.stsfld(context.CurrentRubyClass); cctor.ret(); cctor.Close(); } MethodDef constructor = GenConstructor(evalClass, context); GenInvokeMethod(evalClass, context); return constructor; // } }
internal override void Resolve(PEReader buff) { theClass = (ClassDef)buff.GetElement(MDTable.TypeDef,classIx); theInterface = (Class)buff.GetCodedElement(CIx.TypeDefOrRef,interfacesIndex); theClass.AddImplementedInterface(this); }