_Type.GetConstructors _Type.GetConstructors _Type.GetConstructors _Type.GetConstructors Method

定义

为 COM 对象提供对 GetConstructors 方法的版本无关的访问。Provides COM objects with version-independent access to the GetConstructors method.

重载

GetConstructors() GetConstructors() GetConstructors() GetConstructors()

为 COM 对象提供对 GetConstructors() 方法的版本无关的访问。Provides COM objects with version-independent access to the GetConstructors() method.

GetConstructors(BindingFlags) GetConstructors(BindingFlags) GetConstructors(BindingFlags) GetConstructors(BindingFlags)

为 COM 对象提供对 GetConstructors(BindingFlags) 方法的版本无关的访问。Provides COM objects with version-independent access to the GetConstructors(BindingFlags) method.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetConstructors方法获取当前的构造函数TypeThe Type.GetConstructors method gets the constructors of the current Type.

GetConstructors() GetConstructors() GetConstructors() GetConstructors()

为 COM 对象提供对 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()

返回

ConstructorInfo 对象的数组,表示当前 Type 定义的所有公共实例构造函数,但不包括类型初始值设定项(静态构造函数)。An array of ConstructorInfo objects representing all the public instance constructors defined for the current Type, but not including the type initializer (static constructor). 如果当前 Type 没有定义公共实例构造函数,或者当前 Type 表示泛型类型或方法定义的类型参数,则返回 ConstructorInfo 类型的空数组。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.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetConstructors方法返回当前定义的所有公共构造函数TypeThe Type.GetConstructors method returns all the public constructors defined for the current Type.

GetConstructors(BindingFlags) GetConstructors(BindingFlags) GetConstructors(BindingFlags) GetConstructors(BindingFlags)

为 COM 对象提供对 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()

参数

bindingAttr
BindingFlags BindingFlags BindingFlags BindingFlags

一个位屏蔽,由一个或多个指定搜索执行方式的 BindingFlags 组成。A bitmask comprised of one or more BindingFlags that specify how the search is conducted.

-or- 零,以返回 nullZero, to return null.

返回

表示为当前 ConstructorInfo 定义的匹配指定绑定约束的所有构造函数的 Type 对象数组,包括类型初始值设定项(如果定义的话)。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. 如果当前 Type 没有定义构造函数,或者定义的构造函数都不符合绑定约束,或者当前 Type 表示泛型类型或方法定义的类型参数,则返回 ConstructorInfo 类型的空数组。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.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetConstructors当前定义的构造函数的方法搜索Type,使用指定BindingFlagsThe Type.GetConstructors method searches for the constructors defined for the current Type, using the specified BindingFlags.

适用于