ICustomAttributeProvider 介面

定義

提供自訂屬性以反映支援它們的物件。Provides custom attributes for reflection objects that support them.

public interface class ICustomAttributeProvider
[System.Runtime.InteropServices.ComVisible(true)]
public interface ICustomAttributeProvider
type ICustomAttributeProvider = interface
Public Interface ICustomAttributeProvider
衍生
屬性

備註

幾乎所有的反映類別都可以有與其相關聯的屬性。Nearly all the Reflection classes can have attributes associated with them. 屬性可以是 [標準] (公用、私用、< > Helpstring) 或 [自訂]。Attributes can be standard (public, private, HelpString) or custom.

方法

GetCustomAttributes(Boolean)

傳回這個成員中定義的所有自訂屬性的陣列 (但具名屬性除外),如果沒有自訂屬性,則傳回空陣列。Returns an array of all of the custom attributes defined on this member, excluding named attributes, or an empty array if there are no custom attributes.

GetCustomAttributes(Type, Boolean)

傳回這個成員中定義的自訂屬性陣列 (依類型識別),如果沒有該類型的自訂屬性,則傳回空陣列。Returns an array of custom attributes defined on this member, identified by type, or an empty array if there are no custom attributes of that type.

IsDefined(Type, Boolean)

指出此成員上是否有定義一個或多個 attributeType 執行個體。Indicates whether one or more instance of attributeType is defined on this member.

適用於