英語で読む

次の方法で共有


IReflect.GetProperty メソッド

定義

指定したプロパティに対応する PropertyInfo オブジェクトを取得します。

オーバーロード

GetProperty(String, BindingFlags)

指定した検索制約の下で、指定したプロパティに対応する PropertyInfo オブジェクトを取得します。

GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])

指定した検索制約で、指定したプロパティに対応する PropertyInfo オブジェクトを取得します。

GetProperty(String, BindingFlags)

指定した検索制約の下で、指定したプロパティに対応する PropertyInfo オブジェクトを取得します。

C#
public System.Reflection.PropertyInfo? GetProperty (string name, System.Reflection.BindingFlags bindingAttr);
C#
public System.Reflection.PropertyInfo GetProperty (string name, System.Reflection.BindingFlags bindingAttr);

パラメーター

name
String

検索するプロパティの名前。

bindingAttr
BindingFlags

検索を制御するために使用されるバインディング属性。

戻り値

bindingAttr で指定された検索制約に一致する見つかったプロパティの PropertyInfo オブジェクト。プロパティが見つからなかった場合は null

例外

オブジェクトに複数のフィールドが同じ名前で実装されています。

こちらもご覧ください

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.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, 2.1

GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])

指定した検索制約で、指定したプロパティに対応する PropertyInfo オブジェクトを取得します。

C#
public System.Reflection.PropertyInfo? GetProperty (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, Type? returnType, Type[] types, System.Reflection.ParameterModifier[]? modifiers);
C#
public System.Reflection.PropertyInfo GetProperty (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, Type returnType, Type[] types, System.Reflection.ParameterModifier[] modifiers);

パラメーター

name
String

検索対象のメンバーの名前。

bindingAttr
BindingFlags

検索の制御に使用されるバインディング属性。

binder
Binder

このメソッドに関連するプロパティが含まれ、Binder を実装するオブジェクト。

returnType
Type

プロパティの型。

types
Type[]

同じ名前のオーバーロードされたメソッドからの選択に使用する配列。

modifiers
ParameterModifier[]

パラメーター修飾子の選択に使用する配列。

戻り値

指定した名前のプロパティがこのリフレクション オブジェクトで見つかった場合は、見つかったプロパティの PropertyInfo オブジェクト。プロパティが見つからなかった場合は null

注釈

このメソッドは、 PropertyInfo 指定した検索制約の下で、指定したプロパティに対応するオブジェクトを取得します。 型配列は、オーバーロードされたメソッドの中から選択するために使用されます。

こちらもご覧ください

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.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, 2.1