ComAwareEventInfo.GetCustomAttributes 方法

定義

在衍生類別中遭覆寫時,傳回套用至這個成員的所有屬性。

多載

GetCustomAttributes(Boolean)

在衍生類別中遭覆寫時,取得包含所有套用至此成員之自訂屬性的陣列。

GetCustomAttributes(Type, Boolean)

在衍生類別中遭覆寫時,取得包含所有套用至此成員之指定型別自訂屬性的陣列。

GetCustomAttributes(Boolean)

來源:
ComAwareEventInfo.cs
來源:
ComAwareEventInfo.cs
來源:
ComAwareEventInfo.cs

在衍生類別中遭覆寫時,取得包含所有套用至此成員之自訂屬性的陣列。

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

參數

inherit
Boolean

true 表示要搜尋這個成員的繼承鏈結以尋找屬性;否則為 false

傳回

Object[]

包含所有自訂屬性的陣列,如果沒有定義屬性,則為不包含任何元素的陣列。

例外狀況

這個成員所屬的型別已載入僅限反映的內容中。 請參閱如何:將組件載入僅限反映的內容

無法載入自訂屬性型別。

備註

這個方法會 GetCustomAttributes 呼叫基礎 EventInfo 物件的方法。

另請參閱

適用於

GetCustomAttributes(Type, Boolean)

來源:
ComAwareEventInfo.cs
來源:
ComAwareEventInfo.cs
來源:
ComAwareEventInfo.cs

在衍生類別中遭覆寫時,取得包含所有套用至此成員之指定型別自訂屬性的陣列。

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

參數

attributeType
Type

要搜尋的屬性型別。 只傳回可以指派給這個型別的屬性。

inherit
Boolean

true 表示要搜尋這個成員的繼承鏈結以尋找屬性;否則為 false

傳回

Object[]

包含指定型別所有的自訂屬性之陣列,如果沒有定義屬性,則為不包含任何元素的陣列。

例外狀況

attributeTypenull

這個成員所屬的型別已載入僅限反映的內容中。 請參閱如何:將組件載入僅限反映的內容

無法載入自訂屬性型別。

另請參閱

適用於