PERWAPI.ClassDef.AddMethod C# (CSharp) Метод

AddMethod() публичный Метод

Add a method to this class
public AddMethod ( MethAttr mAtts, ImplAttr iAtts, string name, GenericParam genPars, Type retType, Param pars ) : MethodDef
mAtts MethAttr attributes for this method
iAtts ImplAttr implementation attributes for this method
name string method name
genPars GenericParam generic parameters
retType Type return type
pars Param parameters
Результат MethodDef
        public MethodDef AddMethod(MethAttr mAtts, ImplAttr iAtts, string name,
            GenericParam[] genPars, Type retType, Param[] pars)
        {
            MethodDef meth = AddMethod(name,genPars,retType,pars);
            meth.AddMethAttribute(mAtts);
            meth.AddImplAttribute(iAtts);
            return meth;
        }

Same methods

ClassDef::AddMethod ( MethAttr mAtts, ImplAttr iAtts, string name, Type retType, Param pars ) : MethodDef
ClassDef::AddMethod ( string name, GenericParam genPars, Type retType, Param pars ) : MethodDef
ClassDef::AddMethod ( string name, Type retType, Param pars ) : MethodDef
ClassDef::AddMethod ( MethodDef meth ) : void

Usage Example

Пример #1
0
        internal CodeGenContext CreateMethod(ClassDef ParentClass, MethAttr attr, string name, PERWAPI.Type return_type, params Param[] parameters) {
            CodeGenContext newContext = new CodeGenContext(this);

            newContext.Method = ParentClass.AddMethod(attr, ImplAttr.IL, name, return_type, parameters);

            if ((attr & MethAttr.Static) == 0)
                newContext.Method.AddCallConv(CallConv.Instance);

            newContext.CLRLocals = new List<Local>();

            newContext.Method.CreateCodeBuffer();

            newContext.buffer.OpenScope();

            return newContext;
        }