Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

MethodBuilder.DefineParameter Method

Defines a parameter of this method.

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)

public ParameterBuilder DefineParameter (
	int position,
	ParameterAttributes attributes,
	string strParamName
)
public ParameterBuilder DefineParameter (
	int position, 
	ParameterAttributes attributes, 
	String strParamName
)
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 parameter of this method.
Exception typeCondition

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.

-or-

For the current method, the IsGenericMethod property is true, but the IsGenericMethodDefinition property is false.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.