AssemblyBuilder.GetCustomAttributes 方法

定义

返回已应用于当前 AssemblyBuilder 的自定义属性Returns custom attributes that have been applied to the current AssemblyBuilder

重载

GetCustomAttributes(Boolean)

返回已应用于当前 AssemblyBuilder 的所有自定义属性。Returns all the custom attributes that have been applied to the current AssemblyBuilder.

GetCustomAttributes(Type, Boolean)

返回已应用于当前 AssemblyBuilder 且派生自指定特性类型的所有自定义特性。Returns all the custom attributes that have been applied to the current AssemblyBuilder, and that derive from a specified attribute type.

GetCustomAttributes(Boolean)

返回已应用于当前 AssemblyBuilder 的所有自定义属性。Returns all the custom attributes that have been applied to the current AssemblyBuilder.

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

对于该类型的对象,将忽略此自变量。This argument is ignored for objects of this type.

返回

Object[]

一个包含自定义属性的数组;如果没有任何属性,该数组将为空。An array that contains the custom attributes; the array is empty if there are no attributes.

适用于

GetCustomAttributes(Type, Boolean)

返回已应用于当前 AssemblyBuilder 且派生自指定特性类型的所有自定义特性。Returns all the custom attributes that have been applied to the current AssemblyBuilder, and that derive from a specified attribute type.

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

从中派生特性的基类型。The base type from which attributes derive.

inherit
Boolean

对于该类型的对象,将忽略此自变量。This argument is ignored for objects of this type.

返回

Object[]

包含派生自 attributeType 中任意级别的自定义特性的数组;如果没有此类特性,则数组为空。An array that contains the custom attributes that are derived at any level from attributeType; the array is empty if there are no such attributes.

例外

attributeTypenullattributeType is null.

attributeType 不是由运行时提供的 Type 对象。attributeType is not a Type object supplied by the runtime. 例如,attributeType 是一个 TypeBuilder 对象。For example, attributeType is a TypeBuilder object.

适用于