System.Reflection.Emit.DynamicMethod.DefineParameter Method

Defines a parameter of the dynamic method.

Syntax

public ParameterBuilder DefineParameter (int position, System.Reflection.ParameterAttributes attributes, string parameterName)

Parameters

position
The position of the parameter in the parameter list. Parameters are indexed beginning with the number 1 for the first parameter.
attributes
A bitwise combination of System.Reflection.ParameterAttributes values that specifies the attributes of the parameter.
parameterName
The name of the parameter. The name can be a zero-length string.

Returns

Always returns null.

Remarks

If position is 0, the DynamicMethod.DefineParameter(int, System.Reflection.ParameterAttributes, string) method refers to the return value. Setting parameter information has no effect on the return value.

If the dynamic method has already been completed, by calling the erload:System.Reflection.Emit.DynamicMethod.CreateDelegate or erload:System.Reflection.Emit.DynamicMethod.Invoke method, the DynamicMethod.DefineParameter(int, System.Reflection.ParameterAttributes, string) method has no effect. No exception is thrown.

Requirements

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0