TypeInfo.DeclaredFields 屬性

定義

取得目前類型所定義之欄位的集合。

public:
 virtual property System::Collections::Generic::IEnumerable<System::Reflection::FieldInfo ^> ^ DeclaredFields { System::Collections::Generic::IEnumerable<System::Reflection::FieldInfo ^> ^ get(); };
public virtual System.Collections.Generic.IEnumerable<System.Reflection.FieldInfo> DeclaredFields { get; }
member this.DeclaredFields : seq<System.Reflection.FieldInfo>
Public Overridable ReadOnly Property DeclaredFields As IEnumerable(Of FieldInfo)

屬性值

目前類型所定義之欄位的集合。

備註

若要篩選屬性的結果 DeclaredFields ,請使用 LINQ 查詢。 例如,針對源自執行時間 (的 typeof(Object) 反映物件,例如,) 的結果,您可以使用 類別中的 RuntimeReflectionExtensions 方法周遊繼承樹狀結構。 來自自訂反映內容的物件取用者無法使用這些方法,而且必須周遊繼承樹狀結構本身。

適用於