public MethodDef AddDefinition(MethAttr method_attr, ImplAttr impl_attr, CallConv call_conv, string name, TypeRef return_type, Param[] param_list, TypeRef[] param_type_list, Location location) { string signature = GetSignature(name, return_type, param_type_list); if (MethodDefinedEvent != null) { MethodDefinedEvent(this, new MethodDefinedEventArgs(signature, name, return_type, param_list, table.Contains(signature), method_attr, impl_attr, call_conv)); } MethodTableItem item = (MethodTableItem)table[signature]; if (item == null) { MethodDef method = parent_class.AddMethod(method_attr, impl_attr, name, return_type.Type, param_list); method.AddCallConv(call_conv); AddDefined(signature, method, location); return(method); } item.Method.AddMethAttribute(method_attr); item.Method.AddImplAttribute(impl_attr); item.Method.AddCallConv(call_conv); item.Defined = true; return(item.Method); }
/// <summary> /// Add a "global" method to this module /// </summary> /// <param name="mAtts">method attributes</param> /// <param name="iAtts">method implementation attributes</param> /// <param name="name">method name</param> /// <param name="genPars">generic parameters</param> /// <param name="retType">return type</param> /// <param name="pars">method parameters</param> /// <returns>a descriptor for this new "global" method</returns> public MethodDef AddMethod(MethAttr mAtts, ImplAttr iAtts, string name, GenericParam[] genPars, Type retType, Param[] pars) { //FIXME Contract.Requires(defaultClass != null); MethodDef newMeth = defaultClass.AddMethod(mAtts, iAtts, name, genPars, retType, pars); return(newMeth); }
public MethodDefinedEventArgs(string signature, string name, TypeRef return_type, Param[] param_list, bool is_in_table, MethAttr method_attr, ImplAttr impl_attr, CallConv call_conv) : base(signature, name, return_type, param_list, is_in_table) { MethodAttributes = method_attr; ImplAttributes = impl_attr; CallConv = call_conv; }
public MethodDefinedEventArgs (string signature, string name, TypeRef return_type, Param[] param_list, bool is_in_table, MethAttr method_attr, ImplAttr impl_attr, CallConv call_conv) : base (signature, name, return_type, param_list, is_in_table) { MethodAttributes = method_attr; ImplAttributes = impl_attr; CallConv = call_conv; }
/// <summary> /// Add a method to this class /// </summary> /// <param name="mAtts">attributes for this method</param> /// <param name="iAtts">implementation attributes for this method</param> /// <param name="name">method name</param> /// <param name="retType">return type</param> /// <param name="pars">parameters</param> /// <returns>a descriptor for this new method</returns> public MethodDef AddMethod(MethAttr mAtts, ImplAttr iAtts, string name, Param ret_param, Param [] pars) { // Console.WriteLine("Adding method " + name + " to class " + this.name); MethodDef meth = new MethodDef (metaData, mAtts, iAtts, name, ret_param, pars); methods.Add(meth); return meth; }
/// <summary> /// Add a "global" method to this module /// </summary> /// <param name="mAtts">method attributes</param> /// <param name="iAtts">method implementation attributes</param> /// <param name="name">method name</param> /// <param name="retType">return type</param> /// <param name="pars">method parameters</param> /// <returns>a descriptor for this new "global" method</returns> public MethodDef AddMethod(MethAttr mAtts, ImplAttr iAtts, string name, Type retType, Param[] pars) { return moduleClass.AddMethod(mAtts,iAtts,name,retType,pars); }
internal MethodDef(MetaData md, MethAttr mAttrSet, ImplAttr iAttrSet, string name, Type retType, Param[] pars) : base(name,retType) { metaData = md; parList = pars; if (parList != null) numPars = parList.Length; // Console.WriteLine("Creating method " + name + " with " + numPars + " parameters"); methFlags = (ushort)mAttrSet; implFlags = (ushort)iAttrSet; tabIx = MDTable.Method; }
public MethodDef AddMethod(MethAttr mAtts, ImplAttr iAtts, string name, Type retType, Param[] pars) { return AddMethod (mAtts, iAtts, name, new Param (ParamAttr.Default, "", retType), pars); }
/// <summary> /// Add a method to this class /// </summary> /// <param name="mAtts">attributes for this method</param> /// <param name="iAtts">implementation attributes for this method</param> /// <param name="name">method name</param> /// <param name="genPars">generic parameters</param> /// <param name="retType">return type</param> /// <param name="pars">parameters</param> /// <returns>a descriptor for this new method</returns> public MethodDef AddMethod(MethAttr mAtts, ImplAttr iAtts, string name, GenericParam[] genPars, Type retType, Param[] pars) { Contract.Requires(name != null); Contract.Requires(genPars != null); Contract.Requires(retType != null); Contract.Requires(pars != null); MethodDef meth = AddMethod(name, genPars, retType, pars); meth.AddMethAttribute(mAtts); meth.AddImplAttribute(iAtts); return meth; }
/// <summary> /// Add a "global" method to this module /// </summary> /// <param name="mAtts">method attributes</param> /// <param name="iAtts">method implementation attributes</param> /// <param name="name">method name</param> /// <param name="genPars">generic parameters</param> /// <param name="retType">return type</param> /// <param name="pars">method parameters</param> /// <returns>a descriptor for this new "global" method</returns> public MethodDef AddMethod(MethAttr mAtts, ImplAttr iAtts, string name, GenericParam[] genPars, Type retType, Param[] pars) { //FIXME Contract.Requires(defaultClass != null); MethodDef newMeth = defaultClass.AddMethod(mAtts, iAtts, name, genPars, retType, pars); return newMeth; }
public void SetImplAttributes(ImplAttr ia) { implFlags = (ushort)ia; }
/// <summary> /// Add a method to this class /// </summary> /// <param name="mAtts">attributes for this method</param> /// <param name="iAtts">implementation attributes for this method</param> /// <param name="name">method name</param> /// <param name="genPars">generic parameters</param> /// <param name="retType">return type</param> /// <param name="pars">parameters</param> /// <returns>a descriptor for this new method</returns> 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; }
/// <summary> /// Add a "global" method to this module /// </summary> /// <param name="mAtts">method attributes</param> /// <param name="iAtts">method implementation attributes</param> /// <param name="name">method name</param> /// <param name="genPars">generic parameters</param> /// <param name="retType">return type</param> /// <param name="pars">method parameters</param> /// <returns>a descriptor for this new "global" method</returns> public MethodDef AddMethod(MethAttr mAtts, ImplAttr iAtts, string name, GenericParam[] genPars, Type retType, Param[] pars) { MethodDef newMeth = defaultClass.AddMethod(mAtts,iAtts,name,genPars,retType,pars); return newMeth; }
public MethodDef AddDefinition (MethAttr method_attr, ImplAttr impl_attr, CallConv call_conv, string name, TypeRef return_type, Param[] param_list, TypeRef[] param_type_list, Location location) { string signature = GetSignature (name, return_type, param_type_list); if (MethodDefinedEvent != null) MethodDefinedEvent (this, new MethodDefinedEventArgs (signature, name, return_type, param_list, table.Contains (signature), method_attr, impl_attr, call_conv)); MethodTableItem item = (MethodTableItem) table[signature]; if (item == null) { MethodDef method = parent_class.AddMethod (method_attr, impl_attr, name, return_type.Type, param_list); method.AddCallConv (call_conv); AddDefined (signature, method, location); return method; } item.Method.AddMethAttribute (method_attr); item.Method.AddImplAttribute (impl_attr); item.Method.AddCallConv (call_conv); item.Defined = true; return item.Method; }
internal MethodDef (MetaData md, MethAttr mAttrSet, ImplAttr iAttrSet, string name, Param ret_param, Param [] pars) : base (name) { methFlags = (ushort)mAttrSet; implFlags = (ushort)iAttrSet; this.ret_param = ret_param; metaData = md; parList = pars; if (parList != null) numPars = parList.Length; tabIx = MDTable.Method; }
/// <summary> /// Add some implementation attributes to this method descriptor /// </summary> /// <param name="ia">the attributes to be added</param> public void AddImplAttribute(ImplAttr ia) { implFlags |= (ushort)ia; }