Table of Contents

Class ConstructorInfo

Namespace
System.Reflection
Assembly
mscorlib.dll

Discovers the attributes of a class constructor and provides access to constructor metadata.

public abstract class ConstructorInfo : MethodBase
Inheritance
ConstructorInfo
Inherited Members
Extension Methods

Remarks

Available only in mscorlib build with support for System.Reflection.

Constructors

ConstructorInfo()

protected ConstructorInfo()

Properties

MemberType

Gets a MemberTypes value indicating that this member is a constructor.

public override MemberTypes MemberType { get; }

Property Value

MemberTypes

A MemberTypes value indicating that this member is a constructor.

Methods

GetCustomAttributes(bool)

When overridden in a derived class, returns an array of all custom attributes applied to this member.

public override object[] GetCustomAttributes(bool inherit)

Parameters

inherit bool

true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events.

Returns

object[]

An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined.

Remarks

This method is not implemented in nanoFramework.

Exceptions

NotImplementedException

Invoke(object[])

Invokes the constructor reflected by the instance that has the specified parameters, providing default values for the parameters not commonly used.

public object Invoke(object[] parameters)

Parameters

parameters object[]

An array of values that matches the number, order and type (under the constraints of the default binder) of the parameters for this constructor. If this constructor takes no parameters, then use either an array with zero elements or null, as in Object[] parameters = new Object[0]. Any object in this array that is not explicitly initialized with a value will contain the default value for that object type. For reference-type elements, this value is null. For value-type elements, this value is 0, 0.0, or false, depending on the specific element type.

Returns

object

An instance of the class associated with the constructor.