PropertyBuilder.GetAccessors(Boolean) 方法

定义

返回此属性上的公共和非公共 get 访问 set 器的数组。

public:
 override cli::array <System::Reflection::MethodInfo ^> ^ GetAccessors(bool nonPublic);
public override System.Reflection.MethodInfo[] GetAccessors(bool nonPublic);
override this.GetAccessors : bool -> System.Reflection.MethodInfo[]
Public Overrides Function GetAccessors (nonPublic As Boolean) As MethodInfo()

参数

nonPublic
Boolean

指示是否应在数组中 MethodInfo 返回非公共方法。 true 如果要包括非公共方法,则为否则,为 false.

返回

包含匹配的公共或非公共访问器的类型的 MethodInfo 数组;如果此属性上不存在匹配的访问器,则为空数组。

例外

不支持此方法。

注解

若要获取属性的访问器,请使用 Type.GetType 或 Assembly.GetType 反映属性的父类型,从该类型中检索 Reflection 属性对象,并调用 PropertyInfo.GetAccessors。

适用于