PropertyBuilder.GetSetMethod(Boolean) メソッド

定義

このプロパティの set アクセサーを返します。

public:
 override System::Reflection::MethodInfo ^ GetSetMethod(bool nonPublic);
public override System.Reflection.MethodInfo? GetSetMethod (bool nonPublic);
public override System.Reflection.MethodInfo GetSetMethod (bool nonPublic);
override this.GetSetMethod : bool -> System.Reflection.MethodInfo
Public Overrides Function GetSetMethod (nonPublic As Boolean) As MethodInfo

パラメーター

nonPublic
Boolean

パブリックでないアクセサーの場合に、アクセサーを返すかどうかを示します。 非パブリック メソッドが含まれる場合は true。それ以外の場合は false

戻り値

次の表に示すように、プロパティの Set メソッド、または null

[値] 条件
このプロパティの set メソッドを表す MethodInfo オブジェクト。 set アクセサーがパブリック。

nonPublic が true で、非パブリック メソッドを返すことができる。

nullnonPublic が true で、プロパティが読み取り専用。

nonPublic が false で set アクセサーが非パブリック。

注釈

プロパティのセッターを取得するには、Type.GetType または Assembly.GetType を使用してプロパティの親型を反映し、その型から Reflection プロパティ オブジェクトを取得し、PropertyInfo.GetSetMethod を呼び出します。

適用対象