PropertyBuilder.GetSetMethod(Boolean) メソッド

定義

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

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 で、パブリックでないメソッドを返すことができます。

Null nonPublic は true ですが、プロパティは読み取り専用です。

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

注釈

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

適用対象