ModuleBuilder.GetConstructorToken Method

Definition

Returns the token used to identify the specified constructor within this module.

Overloads

GetConstructorToken(ConstructorInfo)

Returns the token used to identify the specified constructor within this module.

GetConstructorToken(ConstructorInfo, IEnumerable<Type>)

Returns the token used to identify the constructor that has the specified attributes and parameter types within this module.

GetConstructorToken(ConstructorInfo)

Returns the token used to identify the specified constructor within this module.

C#
public System.Reflection.Emit.MethodToken GetConstructorToken(System.Reflection.ConstructorInfo con);
C#
[System.Runtime.InteropServices.ComVisible(true)]
public System.Reflection.Emit.MethodToken GetConstructorToken(System.Reflection.ConstructorInfo con);

Parameters

con
ConstructorInfo

The constructor to get a token for.

Returns

The token used to identify the specified constructor within this module.

Attributes

Exceptions

con is null.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

GetConstructorToken(ConstructorInfo, IEnumerable<Type>)

Returns the token used to identify the constructor that has the specified attributes and parameter types within this module.

C#
public System.Reflection.Emit.MethodToken GetConstructorToken(System.Reflection.ConstructorInfo constructor, System.Collections.Generic.IEnumerable<Type> optionalParameterTypes);

Parameters

constructor
ConstructorInfo

The constructor to get a token for.

optionalParameterTypes
IEnumerable<Type>

A collection of the types of the optional parameters to the constructor.

Returns

The token used to identify the specified constructor within this module.

Exceptions

constructor is null.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1