_MethodBase.GetCustomAttributes 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供 COM 物件對該方法的版本無關存取 GetCustomAttributes 權。
多載
| 名稱 | Description |
|---|---|
| GetCustomAttributes(Boolean) |
提供 COM 物件對該方法的版本無關存取 GetCustomAttributes(Boolean) 權。 |
| GetCustomAttributes(Type, Boolean) |
提供 COM 物件對該方法的版本無關存取 GetCustomAttributes(Type, Boolean) 權。 |
備註
此方法用於存取非受管理程式碼中的受管理類別,不應從受管理程式碼呼叫。
成員會 GetCustomAttributes 回傳所有套用於該成員的屬性。
GetCustomAttributes(Boolean)
提供 COM 物件對該方法的版本無關存取 GetCustomAttributes(Boolean) 權。
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
true搜尋該成員的繼承鏈以尋找屬性;否則,。 false
傳回
包含所有自訂屬性的陣列,或若未定義屬性則為零(0)元素的陣列。
備註
此方法用於存取非受管理程式碼中的受管理類別,不應從受管理程式碼呼叫。
該 GetCustomAttributes 方法會回傳一個包含所有自訂屬性的陣列。
適用於
GetCustomAttributes(Type, Boolean)
提供 COM 物件對該方法的版本無關存取 GetCustomAttributes(Type, Boolean) 權。
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
要搜尋的屬性類型。 只有可指派到此類型的屬性才會回傳。
- inherit
- Boolean
true搜尋該成員的繼承鏈以尋找屬性;否則,。 false
傳回
該成員需套用自訂屬性陣列,若未套用屬性則為零(0)元素。
備註
此方法用於存取非受管理程式碼中的受管理類別,不應從受管理程式碼呼叫。
該 GetCustomAttributes 方法會回傳一組由 標示的 Type自訂屬性陣列。