AddImplementedInterface() public method

Add an interface that is implemented by this class
public AddImplementedInterface ( Class iFace ) : void
iFace Class the interface that is implemented
return void
示例#1
0
        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;
            // }
        }
示例#2
0
文件: PERWAPI.cs 项目: nomit007/f4
 internal override void Resolve(PEReader buff)
 {
     theClass = (ClassDef)buff.GetElement(MDTable.TypeDef,classIx);
     theInterface = (Class)buff.GetCodedElement(CIx.TypeDefOrRef,interfacesIndex);
     theClass.AddImplementedInterface(this);
 }