PropertyBuilder.GetAccessors(Boolean) 方法

定義

傳回這個屬性上的公用 (Public) 和非公用 getset 存取子的陣列。

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。

適用於