Assembly.GetCustomAttributesData 方法

定義

傳回已套用至目前 Assembly 之屬性的相關資訊,表示為 CustomAttributeData 物件。

public:
 virtual System::Collections::Generic::IList<System::Reflection::CustomAttributeData ^> ^ GetCustomAttributesData();
public virtual System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributesData ();
abstract member GetCustomAttributesData : unit -> System.Collections.Generic.IList<System.Reflection.CustomAttributeData>
override this.GetCustomAttributesData : unit -> System.Collections.Generic.IList<System.Reflection.CustomAttributeData>
Public Overridable Function GetCustomAttributesData () As IList(Of CustomAttributeData)

傳回

CustomAttributeData 物件的泛型清單,表示已套用至目前組件之屬性的資料。

備註

使用這個方法可檢查僅限反映內容中程式碼的自訂屬性,在自訂屬性本身定義于僅反映內容的程式碼中。 這類 Attribute.GetCustomAttributesAssembly.GetCustomAttributes 方法不能在這類情況下使用,因為它們會建立屬性的實例。 無法執行僅限反映內容中的程式碼。 如需詳細資訊和範例程式碼,請參閱 CustomAttributeData 類別。

適用於