PropertyBuilder.GetSetMethod(Boolean) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回此属性的 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如下表所示。
| 值 | 条件 |
|---|---|
| 一个 MethodInfo 表示此属性的 Set 方法的对象。 | set 访问器是公共的。
|
| 空 |
nonPublic 为 true,但属性为只读。
|
注解
若要获取属性的 setter,请使用 Type.GetType 或 Assembly.GetType 反映属性的父类型,从该类型中检索 Reflection 属性对象,并调用 PropertyInfo.GetSetMethod。