Open sandboxFocus

Method GetConstructor

GetConstructor(Type, BindingFlags, string)

Gets a constructor from a type by its binding flags and MethodInfo.ToString() signature.

Declaration
public static ConstructorInfo GetConstructor(this Type type, BindingFlags bindingFlags, string signature)
Parameters
Type Name Description
Type type

The type containing the constructor.

BindingFlags bindingFlags

The binding flags to use when searching for the constructor.

string signature

The full signature of the constructor as returned by MethodInfo.ToString().

Returns
Type Description
ConstructorInfo

The ConstructorInfo matching the specified criteria.

Exceptions
Type Condition
InvalidOperationException

No constructor with the specified signature was found.

AmbiguousMatchException

More than one constructor with the specified signature was found.