Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DefineParameter Method

ConstructorBuilder.DefineParameter Method

Defines the name and attributes of a parameter of this constructor.

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

public ParameterBuilder DefineParameter(
	int iSequence,
	ParameterAttributes attributes,
	string strParamName
)

Parameters

iSequence
Type: System.Int32
The position of the parameter in the parameter list. Parameters are indexed beginning with the number 1 for the first parameter.
attributes
Type: System.Reflection.ParameterAttributes
The attributes of the parameter.
strParamName
Type: System.String
The name of the parameter. The name can be a null string.

Return Value

Type: System.Reflection.Emit.ParameterBuilder
An object that represents the parameter.

ExceptionCondition
ArgumentOutOfRangeException

iSequence is less than or equal to zero, or it is greater than the number of parameters of the constructor.

InvalidOperationException

The containing type has been created using CreateType.

You can use the ParameterInfo that is returned by this method to add custom attributes to the parameter.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2015 Microsoft