_ConstructorInfo.GetCustomAttributes _ConstructorInfo.GetCustomAttributes _ConstructorInfo.GetCustomAttributes _ConstructorInfo.GetCustomAttributes Method

定义

为 COM 对象提供对 GetCustomAttributes 成员的版本无关的访问。Provides COM objects with version-independent access to the GetCustomAttributes members.

重载

GetCustomAttributes(Boolean) GetCustomAttributes(Boolean) GetCustomAttributes(Boolean) GetCustomAttributes(Boolean)

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

GetCustomAttributes(Type, Boolean) GetCustomAttributes(Type, Boolean) GetCustomAttributes(Type, Boolean) GetCustomAttributes(Type, Boolean)

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

注解

GetCustomAttributes成员返回应用于此成员的所有属性。The GetCustomAttributes members return all attributes applied to this member.

GetCustomAttributes(Boolean) GetCustomAttributes(Boolean) GetCustomAttributes(Boolean) GetCustomAttributes(Boolean)

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

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

参数

inherit
Boolean Boolean Boolean Boolean

指定是否搜索此成员的继承链以查找属性。Specifies whether to search this member's inheritance chain to find the attributes.

返回

Object[]

一个包含所有自定义属性的数组,在未定义任何特性时为包含零个元素的数组。An array that contains all the custom attributes, or an array with zero elements if no attributes are defined.

注解

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

GetCustomAttributes方法返回一个数组,包含所有自定义属性。The GetCustomAttributes method returns an array containing all the custom attributes.

GetCustomAttributes(Type, Boolean) GetCustomAttributes(Type, Boolean) GetCustomAttributes(Type, Boolean) GetCustomAttributes(Type, Boolean)

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

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

参数

attributeType
Type Type Type Type

要搜索的属性的类型。The type of attribute to search for. 仅返回可分配给此类型的属性。Only attributes that are assignable to this type are returned.

inherit
Boolean Boolean Boolean Boolean

指定是否搜索此成员的继承链以查找属性。Specifies whether to search this member's inheritance chain to find the attributes.

返回

Object[]

应用于此成员的自定义属性的数组;如果未应用任何特性,则为包含零 (0) 个元素的数组。An array of custom attributes applied to this member, or an array with zero (0) elements if no attributes have been applied.

注解

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

GetCustomAttributes方法返回的标识的自定义属性数组TypeThe GetCustomAttributes method returns an array of custom attributes identified by Type.

适用于