Mono Class Library: System.Type Overview | Members

System.Type.GetConstructors Method

Returns an array of constructors defined in the type represented by the current instance, under the specified binding constraints.

[System.Runtime.InteropServices.ComVisible(true)]
public abstract System.Reflection.ConstructorInfo[] GetConstructors (System.Reflection.BindingFlags bindingAttr)

Parameters

bindingAttr
A bitwise combination of System.Reflection.BindingFlags values that control the binding process. If zero is specified, this method returns null .

Returns

An array of System.Reflection.ConstructorInfo objects that reflect the constructors that are defined in the type represented by the current instance and match the constraints of bindingAttr. If System.Reflection.BindingFlags.NonPublic and System.Reflection.BindingFlags.Static are specified, this array includes the type initializer if it is defined. If no constructors meeting the constraints of bindingAttr are defined in the type represented by the current instance, or if the current instance represents an unassigned type parameter of a generic type or method, returns an empty array. If the type represented by the current instance is contained in a loaded assembly, the constructors that match the specified criteria are not public, and the caller does not have sufficient permission, returns null .

If the current instance represents a generic type, this method returns the System.Reflection.ConstructorInfo objects with the type parameters replaced by the appropriate type arguments.

If the current instance represents a generic type parameter, the Type.GetConstructorsmethod returns an empty array.

Permissions

TypeReason
System.Security.Permissions.ReflectionPermissionRequires permission to retrieve information on non-public members of types in loaded assemblies. See System.Security.Permissions.ReflectionPermissionFlag.TypeInformation.

Remarks

The following System.Reflection.BindingFlags are used to define which constructors to include in the search:

Note: For more information, see System.Reflection.BindingFlags.

Operation
As described above.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0