AccessibleObject.IReflect.GetFields(BindingFlags) AccessibleObject.IReflect.GetFields(BindingFlags) AccessibleObject.IReflect.GetFields(BindingFlags) Method


获取与当前类的所有字段对应的 FieldInfo 对象的数组。Gets an array of FieldInfo objects corresponding to all fields of the current class. 有关此成员的说明,请参见 GetFields(BindingFlags)For a description of this member, see GetFields(BindingFlags).

 virtual cli::array <System::Reflection::FieldInfo ^> ^ System.Reflection.IReflect.GetFields(System::Reflection::BindingFlags bindingAttr) = System::Reflection::IReflect::GetFields;
System.Reflection.FieldInfo[] IReflect.GetFields (System.Reflection.BindingFlags bindingAttr);
Function GetFields (bindingAttr As BindingFlags) As FieldInfo() Implements IReflect.GetFields


BindingFlags BindingFlags BindingFlags

用于控制搜索的绑定属性。The binding attributes used to control the search.


FieldInfo 对象的数组,包含此反射对象的符合 bindingAttr 中指定的搜索约束的所有字段信息。An array of FieldInfo objects containing all the field information for this reflection object that meets the search constraints specified in bindingAttr.



每个字段都必须具有唯一的名称。Each field must have a unique name. BindingFlags.NonPublic标志指定包含在搜索中的非公共字段。The BindingFlags.NonPublic flag specifies that nonpublic fields are included in the search. BindingFlags.Public标志指定在搜索中包含公共字段。The BindingFlags.Public flag specifies that public fields are included in the search.

此成员是显式接口成员的实现。This member is an explicit interface member implementation. 它只能在 AccessibleObject 实例被强制转换为 IReflect 接口时使用。It can be used only when the AccessibleObject instance is cast to an IReflect interface.