DefineParameter() public method

public DefineParameter ( int position, ParameterAttributes attributes, string strParamName ) : IKVM.Reflection.Emit.ParameterBuilder
position int
attributes ParameterAttributes
strParamName string
return IKVM.Reflection.Emit.ParameterBuilder
			private static void SetParameters(ClassLoaderWrapper loader, MethodBuilder mb, IKVM.Internal.MapXml.Param[] parameters)
			{
				if(parameters != null)
				{
					for(int i = 0; i < parameters.Length; i++)
					{
						ParameterBuilder pb = mb.DefineParameter(i + 1, ParameterAttributes.None, parameters[i].Name);
						if(parameters[i].Attributes != null)
						{
							for(int j = 0; j < parameters[i].Attributes.Length; j++)
							{
								AttributeHelper.SetCustomAttribute(loader, pb, parameters[i].Attributes[j]);
							}
						}
					}
				}
			}
示例#2
0
 protected override TypeBuilder DefineGhostType(string mangledTypeName, TypeAttributes typeAttribs)
 {
     typeAttribs &= ~(TypeAttributes.Interface | TypeAttributes.Abstract);
     typeAttribs |= TypeAttributes.Class | TypeAttributes.Sealed;
     TypeBuilder typeBuilder = classLoader.GetTypeWrapperFactory().ModuleBuilder.DefineType(mangledTypeName, typeAttribs, Types.ValueType);
     AttributeHelper.SetGhostInterface(typeBuilder);
     AttributeHelper.SetModifiers(typeBuilder, Modifiers, IsInternal);
     ghostRefField = typeBuilder.DefineField("__<ref>", Types.Object, FieldAttributes.Public | FieldAttributes.SpecialName);
     typeBuilderGhostInterface = typeBuilder.DefineNestedType("__Interface", TypeAttributes.Interface | TypeAttributes.Abstract | TypeAttributes.NestedPublic);
     AttributeHelper.HideFromJava(typeBuilderGhostInterface);
     ghostIsInstanceMethod = typeBuilder.DefineMethod("IsInstance", MethodAttributes.HideBySig | MethodAttributes.Public | MethodAttributes.Static, Types.Boolean, new Type[] { Types.Object });
     ghostIsInstanceMethod.DefineParameter(1, ParameterAttributes.None, "obj");
     ghostIsInstanceArrayMethod = typeBuilder.DefineMethod("IsInstanceArray", MethodAttributes.HideBySig | MethodAttributes.Public | MethodAttributes.Static, Types.Boolean, new Type[] { Types.Object, Types.Int32 });
     ghostIsInstanceArrayMethod.DefineParameter(1, ParameterAttributes.None, "obj");
     ghostIsInstanceArrayMethod.DefineParameter(2, ParameterAttributes.None, "rank");
     ghostCastMethod = typeBuilder.DefineMethod("Cast", MethodAttributes.HideBySig | MethodAttributes.Public | MethodAttributes.Static, typeBuilder, new Type[] { Types.Object });
     ghostCastMethod.DefineParameter(1, ParameterAttributes.None, "obj");
     ghostCastArrayMethod = typeBuilder.DefineMethod("CastArray", MethodAttributes.HideBySig | MethodAttributes.Public | MethodAttributes.Static, Types.Void, new Type[] { Types.Object, Types.Int32 });
     ghostCastArrayMethod.DefineParameter(1, ParameterAttributes.None, "obj");
     ghostCastArrayMethod.DefineParameter(2, ParameterAttributes.None, "rank");
     return typeBuilder;
 }