NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Type.FindMembers

Returns a filtered array of MemberInfo objects of the specified member type.

[Visual Basic]
Overridable Public Function FindMembers( _
   ByVal memberType As MemberTypes, _
   ByVal bindingAttr As BindingFlags, _
   ByVal filter As MemberFilter, _
   ByVal filterCriteria As Object _
) As MemberInfo ()
[C#]
public virtual MemberInfo[] FindMembers(
   MemberTypes memberType,
   BindingFlags bindingAttr,
   MemberFilter filter,
   object filterCriteria
);
[C++]
public: virtual MemberInfo* FindMembers(
   MemberTypes memberType,
   BindingFlags bindingAttr,
   MemberFilter* filter,
   Object* filterCriteria
) [];
[JScript]
public function FindMembers(
   memberType : MemberTypes,
   bindingAttr : BindingFlags,
   filter : MemberFilter,
   filterCriteria : Object
) : MemberInfo[];

Parameters

memberType
A MemberTypes object indicating the type of member to search for.
bindingAttr
A bit mask comprised of one or more BindingFlags that specify how the search is conducted.

-or-

zero, to conduct a case-sensitive search for public methods.

filter
The delegate that actually does the comparisons, returning true if the member currently being inspected matches the filterCriteria and false otherwise. The FilterAttribute, FilterName, and FilterNameIgnoreCase delegates supplied by this class may be used. The first uses the fields of FieldAttributes, MethodAttributes, and MethodImplAttributes as search criteria, and the latter uses String objects as the search criteria.
filterCriteria
The search criteria that determines whether a member is returned in the array of MemberInfo objects.

The fields of FieldAttributes, MethodAttributes, and MethodImplAttributes may be used in conjunction with the FilterAttribute delegate supplied by this class.

Return Value

A filtered array of MemberInfo objects of the specified member type.

-or-

An empty array of type MemberInfo, if the current Type does not have members of type memberType that match the filter criteria.

Exceptions

Exception Type Condition
ArgumentNullException filter is a null reference (in Visual Basic Nothing).
SecurityException The caller does not have permission to reflect non-public members outside of the current assembly.

Remarks

This method can be overridden by a derived class.

Members include properties, methods, fields, events, and so on.

The following BindingFlags filter flags can be used to define which members should be included in the search:

The following BindingFlags modifier flags can be used to change how the search works:

See BindingFlags for more information.

Valid values for MemberType are defined in MemberInfo. If no such members are found, an empty array is returned.

The permission to reflect members is defined by the ReflectionPermission class.

Class initializers are available through GetMember, GetMembers, FindMembers, and GetConstructors.

See Also

Type Class | Type Members | System Namespace | ReflectionPermission