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

定义

返回具有指定名称、类型并由此类型声明或继承其绑定的所有成员。Returns all members with the specified name, type, and binding that are declared or inherited by this type.

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 member that is to be returned.

bindingAttr
BindingFlags BindingFlags BindingFlags BindingFlags

这必须是来自 BindingFlags 的位标志:InvokeMethodNonPublic 等等。This must be a bit flag from BindingFlags : 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 currently supported in types that are not complete.

注解

解决方法:若要检索已完成类型的成员,请使用Type.GetTypeAssembly.GetType检索该类型,并在检索到的类型上使用反射。As a workaround, to retrieve the member of a finished type, retrieve the type using Type.GetType or Assembly.GetType and use reflection on the retrieved type.

适用于