_Type.GetConstructors Method

Definition

Provides COM objects with version-independent access to the GetConstructors method.

Overloads

GetConstructors()

Provides COM objects with version-independent access to the GetConstructors() method.

GetConstructors(BindingFlags)

Provides COM objects with version-independent access to the GetConstructors(BindingFlags) method.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The Type.GetConstructors method gets the constructors of the current Type.

GetConstructors()

Provides COM objects with version-independent access to the GetConstructors() method.

public:
 cli::array <System::Reflection::ConstructorInfo ^> ^ GetConstructors();
public System.Reflection.ConstructorInfo[] GetConstructors ();
abstract member GetConstructors : unit -> System.Reflection.ConstructorInfo[]
Public Function GetConstructors () As ConstructorInfo()

Returns

An array of ConstructorInfo objects representing all the public instance constructors defined for the current Type, but not including the type initializer (static constructor). If no public instance constructors are defined for the current Type, or if the current Type represents a type parameter of a generic type or method definition, an empty array of type ConstructorInfo is returned.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The Type.GetConstructors method returns all the public constructors defined for the current Type.

Applies to

GetConstructors(BindingFlags)

Provides COM objects with version-independent access to the GetConstructors(BindingFlags) method.

public:
 cli::array <System::Reflection::ConstructorInfo ^> ^ GetConstructors(System::Reflection::BindingFlags bindingAttr);
public System.Reflection.ConstructorInfo[] GetConstructors (System.Reflection.BindingFlags bindingAttr);
abstract member GetConstructors : System.Reflection.BindingFlags -> System.Reflection.ConstructorInfo[]
Public Function GetConstructors (bindingAttr As BindingFlags) As ConstructorInfo()

Parameters

bindingAttr
BindingFlags

A bitmask comprised of one or more BindingFlags that specify how the search is conducted.

-or-

Zero, to return null.

Returns

An array of ConstructorInfo objects representing all constructors defined for the current Type that match the specified binding constraints, including the type initializer if it is defined. Returns an empty array of type ConstructorInfo if no constructors are defined for the current Type, if none of the defined constructors match the binding constraints, or if the current Type represents a type parameter of a generic type or method definition.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The Type.GetConstructors method searches for the constructors defined for the current Type, using the specified BindingFlags.

Applies to