NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Type.GetConstructors (BindingFlags)

When implemented by a derived class, searches for the constructors defined for the current Type, using the specified binding constraints.

[Visual Basic]
Overloads MustOverride Public Function GetConstructors( _
   ByVal bindingAttr As BindingFlags _
) As ConstructorInfo ()
[C#]
public abstract ConstructorInfo[] GetConstructors(
   BindingFlags bindingAttr
);
[C++]
public: virtual ConstructorInfo* GetConstructors(
   BindingFlags bindingAttr
) [] = 0;
[JScript]
public abstract function GetConstructors(
   bindingAttr : BindingFlags
) : ConstructorInfo[];

Parameters

bindingAttr
A bit mask comprised of one or more BindingFlags that specify how the search is conducted.

-or-

zero, to conduct a case-sensitive search for public methods.

Return Value

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.

-or-

An empty array of type ConstructorInfo, if no constructors are defined for the current Type, or if none of the defined constructors match the binding constraints.

Exceptions

Exception Type Condition
SecurityException The BindingFlags value Public is used but the caller does not have ReflectionPermission to reflect non-public members outside the current assembly.

Remarks

Abstract. This method must be implemented by a derived class.

bindingAttr can be used to specify whether to return only public constructors or both public and non-public constructors.

If an exact match does not exist, the binder will attempt to coerce the parameter types specified in the types array in order to select a match. If the binder is unable to select a match, then a null reference (in Visual Basic Nothing) is returned.

The following BindingFlags filter flags can be used to define which constructors should be included in the search:

See BindingFlags for more information.Class initializers are available through GetMember, GetMembers, FindMembers, and GetConstructors.

See Also

Type Class | Type Members | System Namespace | Type.GetConstructors Overload List