Export (0) Print
Expand All

MethodBuilder.DefineParameter Method

Defines a parameter of this method.

[Visual Basic]
Public Function DefineParameter( _
   ByVal position As Integer, _
   ByVal attributes As ParameterAttributes, _
   ByVal strParamName As String _
) As ParameterBuilder
[C#]
public ParameterBuilder DefineParameter(
 int position,
 ParameterAttributes attributes,
 string strParamName
);
[C++]
public: ParameterBuilder* DefineParameter(
 int position,
 ParameterAttributes attributes,
 String* strParamName
);
[JScript]
public function DefineParameter(
   position : int,
 attributes : ParameterAttributes,
 strParamName : String
) : ParameterBuilder;

Parameters

position
The position of the parameter in the parameter list. Parameters are indexed beginning with the number 1 for the first parameter.
attributes
The attributes of the parameter.
strParamName
The name of the parameter. The name can be the null string.

Return Value

Returns a ParameterBuilder object that represents the new parrameter of this method.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException The method has no parameters.

-or-

position is less than or equal to zero.

-or-

position is greater than the number of the method's parameters.

InvalidOperationException The containing type was previously created using CreateType

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

MethodBuilder Class | MethodBuilder Members | System.Reflection.Emit Namespace

Show:
© 2014 Microsoft