TypeBuilder.GetMember(String, MemberTypes, BindingFlags) TypeBuilder.GetMember(String, MemberTypes, BindingFlags) TypeBuilder.GetMember(String, MemberTypes, BindingFlags) TypeBuilder.GetMember(String, MemberTypes, BindingFlags) Method

定义

按照指定,返回此类型声明或继承的所有公共和非公共成员。Returns all the public and non-public members declared or inherited by this type, as specified.

public:
 override cli::array <System::Reflection::MemberInfo ^> ^ GetMember(System::String ^ name, System::Reflection::MemberTypes type, System::Reflection::BindingFlags bindingAttr);
public override System.Reflection.MemberInfo[] GetMember (string name, System.Reflection.MemberTypes type, System.Reflection.BindingFlags bindingAttr);
override this.GetMember : string * System.Reflection.MemberTypes * System.Reflection.BindingFlags -> System.Reflection.MemberInfo[]
Public Overrides Function GetMember (name As String, type As MemberTypes, bindingAttr As BindingFlags) As MemberInfo()

参数

name
String String String String

成员名。The name of the member.

type
MemberTypes MemberTypes MemberTypes MemberTypes

要返回的成员的类型。The type of the member to return.

bindingAttr
BindingFlags BindingFlags BindingFlags BindingFlags

这必须是 BindingFlags 的位标志,例如 InvokeMethodNonPublic 等中的位标志。This must be a bit flag from BindingFlags, as in InvokeMethod, NonPublic, and so on.

返回

如果使用 nonPublic,则返回 MemberInfo 对象的数组,表示在此类型上定义的公共和非公共成员;否则,仅返回公共成员。Returns an array of MemberInfo objects representing the public and non-public members defined on this type if nonPublic is used; otherwise, only the public members are returned.

异常

不会为不完整类型实现此方法。This method is not implemented for incomplete types.

注解

使用Type.GetTypeAssembly.GetType检索类型,并对检索到的类型使用反射。Retrieve the type using Type.GetType or Assembly.GetType and use reflection on the retrieved type.

适用于