+ private int table_idx;
+ private byte[] code;
+ private ILGenerator ilgen;
+ private TypeBuilder type;
+ private ParameterBuilder[] pinfo;
+ private CustomAttributeBuilder[] cattrs;
+ private MethodInfo override_method;
+ private string pi_dll;
+ private string pi_entry;
+ private CharSet ncharset;
+ private CallingConvention native_cc;
+ private CallingConventions call_conv;
+ private bool init_locals = true;
+ private MonoGenericParam[] generic_params;
+ private Type[] returnModReq;
+ private Type[] returnModOpt;
+ private Type[][] paramModReq;
+ private Type[][] paramModOpt;
+ private RefEmitPermissionSet[] permissions;
+
+ internal MethodBuilder (TypeBuilder tb, string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] returnModReq, Type[] returnModOpt, Type[] parameterTypes, Type[][] paramModReq, Type[][] paramModOpt) {
+ this.name = name;
+ this.attrs = attributes;
+ this.call_conv = callingConvention;
+ this.rtype = returnType;
+ this.returnModReq = returnModReq;
+ this.returnModOpt = returnModOpt;
+ this.paramModReq = paramModReq;
+ this.paramModOpt = paramModOpt;
+ // The MSDN docs does not specify this, but the MS MethodBuilder
+ // appends a HasThis flag if the method is not static
+ if ((attributes & MethodAttributes.Static) == 0)
+ this.call_conv |= CallingConventions.HasThis;
+ if (parameterTypes != null) {
+ this.parameters = new Type [parameterTypes.Length];
+ System.Array.Copy (parameterTypes, this.parameters, parameterTypes.Length);
+ }
+ type = tb;
+ table_idx = get_next_table_index (this, 0x06, true);
+ //Console.WriteLine ("index for "+name+" set to "+table_idx.ToString());
+ }
+
+ internal MethodBuilder (TypeBuilder tb, string name, MethodAttributes attributes,
+ CallingConventions callingConvention, Type returnType, Type[] returnModReq, Type[] returnModOpt, Type[] parameterTypes, Type[][] paramModReq, Type[][] paramModOpt,
+ String dllName, String entryName, CallingConvention nativeCConv, CharSet nativeCharset)
+ : this (tb, name, attributes, callingConvention, returnType, returnModReq, returnModOpt, parameterTypes, paramModReq, paramModOpt) {
+ pi_dll = dllName;
+ pi_entry = entryName;
+ native_cc = nativeCConv;
+ ncharset = nativeCharset;
+ }
+
+ public bool InitLocals {
+ get {return init_locals;}
+ set {init_locals = value;}
+ }
+
+ internal TypeBuilder TypeBuilder {
+ get {return type;}
+ }
+
+ public override RuntimeMethodHandle MethodHandle {
+ get {
+ throw NotSupported ();
+ }
+ }
+