_Type.FindMembers(MemberTypes, BindingFlags, MemberFilter, Object) _Type.FindMembers(MemberTypes, BindingFlags, MemberFilter, Object) _Type.FindMembers(MemberTypes, BindingFlags, MemberFilter, Object) _Type.FindMembers(MemberTypes, BindingFlags, MemberFilter, Object) Method

定义

为 COM 对象提供对 FindMembers(MemberTypes, BindingFlags, MemberFilter, Object) 方法的版本无关的访问。Provides COM objects with version-independent access to the FindMembers(MemberTypes, BindingFlags, MemberFilter, Object) method.

public:
 cli::array <System::Reflection::MemberInfo ^> ^ FindMembers(System::Reflection::MemberTypes memberType, System::Reflection::BindingFlags bindingAttr, System::Reflection::MemberFilter ^ filter, System::Object ^ filterCriteria);
public System.Reflection.MemberInfo[] FindMembers (System.Reflection.MemberTypes memberType, System.Reflection.BindingFlags bindingAttr, System.Reflection.MemberFilter filter, object filterCriteria);
abstract member FindMembers : System.Reflection.MemberTypes * System.Reflection.BindingFlags * System.Reflection.MemberFilter * obj -> System.Reflection.MemberInfo[]
Public Function FindMembers (memberType As MemberTypes, bindingAttr As BindingFlags, filter As MemberFilter, filterCriteria As Object) As MemberInfo()

参数

memberType
MemberTypes MemberTypes MemberTypes MemberTypes

指示要搜索的成员类型的 MemberTypes 对象。A MemberTypes object indicating the type of member to search for.

bindingAttr
BindingFlags BindingFlags BindingFlags BindingFlags

一个位屏蔽,由一个或多个指定搜索执行方式的 BindingFlags 组成。A bitmask comprised of one or more BindingFlags that specify how the search is conducted.

- 或 --or- 零,以返回 nullZero, to return null.

filter
MemberFilter MemberFilter MemberFilter MemberFilter

执行比较的委托,如果当前被检查的成员匹配 true,则返回 filterCriteria;否则返回 falseThe delegate that does the comparisons, returning true if the member currently being inspected matches the filterCriteria and false otherwise. 可以使用该类提供的 FilterAttributeFilterNameFilterNameIgnoreCase 委托。You can use the FilterAttribute, FilterName, and FilterNameIgnoreCase delegates supplied by this class. 第一个委托使用 FieldAttributesMethodAttributesMethodImplAttributes 的字段作为搜索判据,另两个委托使用 String 对象作为搜索判据。The first uses the fields of FieldAttributes, MethodAttributes, and MethodImplAttributes as search criteria, and the other two delegates use String objects as the search criteria.

filterCriteria
Object Object Object Object

确定成员是否在 MemberInfo 对象数组中返回的搜索判据。The search criteria that determines whether a member is returned in the array of MemberInfo objects.

FieldAttributesMethodAttributesMethodImplAttributes 的字段可以和该类提供的 FilterAttribute 委托一起使用。The fields of FieldAttributes, MethodAttributes, and MethodImplAttributes can be used in conjunction with the FilterAttribute delegate supplied by this class.

返回

指定成员类型的 MemberInfo 对象的筛选数组。A filtered array of MemberInfo objects of the specified member type.

-or- 如果当前 MemberInfo 没有匹配筛选判据的 Type 类型成员,则为 memberType 类型的空数组。An empty array of type MemberInfo, if the current Type does not have members of type memberType that match the filter criteria.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.FindMembers方法返回的筛选的数组MemberInfo指定的成员类型的对象。The Type.FindMembers method returns a filtered array of MemberInfo objects of the specified member type.

适用于