ModuleBuilder.GetCustomAttributesData 方法

定義

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

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

傳回

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

備註

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

適用於