ConstructorBuilder.GetCustomAttributes 方法

定义

返回为此构造函数定义的自定义属性。

重载

GetCustomAttributes(Boolean)

返回为此构造函数定义的所有自定义属性。

GetCustomAttributes(Type, Boolean)

返回由给定类型标识的自定义属性。

GetCustomAttributes(Boolean)

Source:
ConstructorBuilder.cs

返回为此构造函数定义的所有自定义属性。

public:
 override cli::array <System::Object ^> ^ GetCustomAttributes(bool inherit);
public override object[] GetCustomAttributes (bool inherit);
override this.GetCustomAttributes : bool -> obj[]
Public Overrides Function GetCustomAttributes (inherit As Boolean) As Object()

参数

inherit
Boolean

基类中自定义属性的控件继承。 忽略此参数。

返回

Object[]

一个对象数组,它表示由此 ConstructorBuilder 实例表示的构造函数的所有自定义属性。

例外

目前尚不支持此方法。

注解

参数 inherit 被忽略,因为类从不从基类继承构造函数。

若要获取自定义特性,请通过调用 CreateType完成类型的生成,通过在返回的类型上调用 GetConstructor 方法来检索构造函数,然后在返回ConstructorInfo的 上调用 GetCustomAttributes 方法。

适用于

GetCustomAttributes(Type, Boolean)

Source:
ConstructorBuilder.cs

返回由给定类型标识的自定义属性。

public:
 override cli::array <System::Object ^> ^ GetCustomAttributes(Type ^ attributeType, bool inherit);
public override object[] GetCustomAttributes (Type attributeType, bool inherit);
override this.GetCustomAttributes : Type * bool -> obj[]
Public Overrides Function GetCustomAttributes (attributeType As Type, inherit As Boolean) As Object()

参数

attributeType
Type

自定义属性类型。

inherit
Boolean

基类中自定义属性的控件继承。 忽略此参数。

返回

Object[]

一个对象数组,它表示此构造函数的新属性。

例外

目前尚不支持此方法。

注解

参数 inherit 被忽略,因为类从不从基类继承构造函数。

若要获取自定义特性,请通过调用 CreateType完成类型的生成,通过在返回的类型上调用 GetConstructor 方法来检索构造函数,然后在返回ConstructorInfo的 上调用 GetCustomAttributes 方法。

适用于