Returns an array of constructors defined in the type represented by the current instance, under the specified binding constraints.
- bindingAttr
- A bitwise combination of System.Reflection.BindingFlags values that control the binding process. If zero is specified, this method returns null .
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.
Type Reason System.Security.Permissions.ReflectionPermission Requires permission to retrieve information on non-public members of types in loaded assemblies. See System.Security.Permissions.ReflectionPermissionFlag.TypeInformation.
The following System.Reflection.BindingFlags are used to define which constructors to include in the search:
- Specify either System.Reflection.BindingFlags.Instance or System.Reflection.BindingFlags.Static to get a return value other than null.
- Specify System.Reflection.BindingFlags.Public to include public constructors in the search.
- Specify System.Reflection.BindingFlags.NonPublic to include non-public constructors (that is, private and protected constructors) in the search.
Note: For more information, see System.Reflection.BindingFlags.Operation
As described above.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0