MethodBuilder.GetCustomAttributes 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳此方法定義的自訂屬性。
多載
| 名稱 | Description |
|---|---|
| GetCustomAttributes(Type, Boolean) |
回傳由指定類型識別的自訂屬性。 |
| GetCustomAttributes(Boolean) |
會回傳此方法所有自訂屬性。 |
GetCustomAttributes(Type, Boolean)
回傳由指定類型識別的自訂屬性。
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
指定是否要搜尋此成員的繼承鏈以尋找自訂屬性。
傳回
回傳一個代表此方法屬性的物件陣列,這些屬性型別為 attributeType。
例外狀況
此方法目前尚未支援。 用 取得 GetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) 方法,並呼叫 GetCustomAttributes(Boolean) 返回 MethodInfo的 。
適用於
GetCustomAttributes(Boolean)
會回傳此方法所有自訂屬性。
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
指定是否要搜尋此成員的繼承鏈以尋找自訂屬性。
傳回
回傳一個代表此方法所有自訂屬性的物件陣列。
例外狀況
此方法目前尚未支援。 用 取得 GetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) 方法,並呼叫 GetCustomAttributes(Boolean) 返回 MethodInfo的 。