TypeInfo.DeclaredFields 屬性


取得目前類型所定義之欄位的集合。Gets a collection of the fields defined by the current type.

 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)


目前類型所定義之欄位的集合。A collection of the fields defined by the current type.


若要篩選DeclaredFields屬性的結果,請使用 LINQ 查詢。To filter the results of the DeclaredFields property, use LINQ queries. 針對源自執行時間的反映物件(例如,做為的結果typeof(Object)),您可以使用RuntimeReflectionExtensions類別中的方法來流覽繼承樹狀結構。For reflection objects that originate with the runtime (for example, as the result of typeof(Object)), you can traverse the inheritance tree by using the methods in the RuntimeReflectionExtensions class. 來自自訂反映內容之物件的取用者不能使用這些方法,而且必須跨越繼承樹狀結構本身。Consumers of objects from customized reflection contexts cannot use these methods and must traverse the inheritance tree themselves.