_Type.GetMembers Method

Definition

Provides COM objects with version-independent access to the GetMembers method.

Overloads

GetMembers()

Provides COM objects with version-independent access to the GetMembers() method.

GetMembers(BindingFlags)

Provides COM objects with version-independent access to the GetMembers(BindingFlags) method.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The Type.GetMembers method gets the members (properties, methods, fields, events, and so on) of the current Type.

GetMembers()

Provides COM objects with version-independent access to the GetMembers() method.

public:
 cli::array <System::Reflection::MemberInfo ^> ^ GetMembers();
public System.Reflection.MemberInfo[] GetMembers ();
abstract member GetMembers : unit -> System.Reflection.MemberInfo[]
Public Function GetMembers () As MemberInfo()

Returns

An array of MemberInfo objects representing all the public members of the current Type.

-or-

An empty array of type MemberInfo, if the current Type does not have public members.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The Type.GetMembers method returns all the public members of the current Type.

GetMembers(BindingFlags)

Provides COM objects with version-independent access to the GetMembers(BindingFlags) method.

public:
 cli::array <System::Reflection::MemberInfo ^> ^ GetMembers(System::Reflection::BindingFlags bindingAttr);
public System.Reflection.MemberInfo[] GetMembers (System.Reflection.BindingFlags bindingAttr);
abstract member GetMembers : System.Reflection.BindingFlags -> System.Reflection.MemberInfo[]
Public Function GetMembers (bindingAttr As BindingFlags) As MemberInfo()

Parameters

bindingAttr
BindingFlags

A bitmask comprised of one or more BindingFlags that specify how the search is conducted.

-or-

Zero, to return null.

Returns

An array of MemberInfo objects representing all members defined for the current Type that match the specified binding constraints.

-or-

An empty array of type MemberInfo, if no members are defined for the current Type, or if none of the defined members match the binding constraints.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The Type.GetMembers method searches for the members defined for the current Type, using the specified binding constraints.

Applies to