ConstructorBuilder.GetCustomAttributes 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳為此建構子定義的自訂屬性。
多載
| 名稱 | Description |
|---|---|
| GetCustomAttributes(Boolean) |
回傳所有為此建構子定義的自訂屬性。 |
| GetCustomAttributes(Type, Boolean) |
回傳由指定類型識別的自訂屬性。 |
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
控制從基底類別繼承自訂屬性。 這個參數已忽略。
傳回
一個物件陣列,代表由此 ConstructorBuilder 實例所代表的所有建構子自訂屬性。
例外狀況
此方法目前尚未支援。
備註
inherit這個參數被忽略,因為類別從不繼承基底類別的建構子。
要取得自訂屬性,請先呼叫 CreateType建置型別,然後呼叫返回型別的方法,再 GetConstructor 呼叫 GetCustomAttributes 回傳 ConstructorInfo的方法。
適用於
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
控制從基底類別繼承自訂屬性。 這個參數已忽略。
傳回
一個代表此建構子屬性的物件陣列。
例外狀況
此方法目前尚未支援。
備註
inherit這個參數被忽略,因為類別從不繼承基底類別的建構子。
要取得自訂屬性,請先呼叫 CreateType建置型別,然後呼叫返回型別的方法,再 GetConstructor 呼叫 GetCustomAttributes 回傳 ConstructorInfo的方法。