_Type.GetCustomAttributes _Type.GetCustomAttributes _Type.GetCustomAttributes _Type.GetCustomAttributes Method

定义

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

重载

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.

注解

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

MemberInfo.GetCustomAttributes方法返回应用于此成员的所有属性。The MemberInfo.GetCustomAttributes method returns 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[]

应用于此成员的自定义属性的数组;如果未应用任何特性,则为包含零 (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.

Assembly.GetCustomAttributes方法返回应用于此成员的所有属性。The Assembly.GetCustomAttributes method returns all attributes applied to this member.

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.

MemberInfo.GetCustomAttributes方法返回应用于此成员的所有属性。The MemberInfo.GetCustomAttributes method returns all attributes applied to this member.

适用于