TypeBuilder.GetCustomAttributes メソッド
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
この型の定義済みのカスタム属性を返します。
GetCustomAttributes(Boolean) |
この型の定義済みのカスタム属性をすべて返します。 |
GetCustomAttributes(Type, Boolean) |
現在の型のカスタム属性のうち、指定された型に代入可能なものすべてを返します。 |
- ソース:
- TypeBuilder.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
このメンバーの継承チェーンを検索して属性を見つけるかどうかを指定します。
戻り値
この型のすべてのカスタム属性を表す、オブジェクトの配列を返します。
例外
不完全な型では、このメソッドは現在サポートされていません。 GetType() を使用して型を取得し、返された GetCustomAttributes(Boolean) で Typeを呼び出します。
適用対象
.NET 10 およびその他のバージョン
製品 | バージョン |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided), 2.1 |
- ソース:
- TypeBuilder.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
このメンバーの継承チェーンを検索して属性を見つけるかどうかを指定します。
戻り値
現在の型について定義されているカスタム属性の配列。
例外
不完全な型では、このメソッドは現在サポートされていません。 GetType() を使用して型を取得し、返された GetCustomAttributes(Boolean) で Typeを呼び出します。
attributeType
が null
です。
型は、基になるランタイム システムで提供されている型でなければなりません。
適用対象
.NET 10 およびその他のバージョン
製品 | バージョン |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided), 2.1 |
.NET に関するフィードバック
.NET はオープンソース プロジェクトです。 フィードバックを提供するにはリンクを選択します。