EnumBuilder.GetNestedType(String, BindingFlags) EnumBuilder.GetNestedType(String, BindingFlags) EnumBuilder.GetNestedType(String, BindingFlags) EnumBuilder.GetNestedType(String, BindingFlags) Method

定义

返回此类型声明的指定嵌套类型。Returns the specified nested type that is declared by this type.

public:
 override Type ^ GetNestedType(System::String ^ name, System::Reflection::BindingFlags bindingAttr);
public override Type GetNestedType (string name, System.Reflection.BindingFlags bindingAttr);
override this.GetNestedType : string * System.Reflection.BindingFlags -> Type
Public Overrides Function GetNestedType (name As String, bindingAttr As BindingFlags) As Type

参数

name
String String String String

包含要获取的嵌套类型的名称的 StringThe String containing the name of the nested type to get.

bindingAttr
BindingFlags BindingFlags BindingFlags BindingFlags

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

-or- 零,表示对公共方法执行区分大小写的搜索。Zero, to conduct a case-sensitive search for public methods.

返回

表示符合指定要求的嵌套类型的 Type 对象(如果找到);否则为 nullA Type object representing the nested type that matches the specified requirements, if found; otherwise, null.

异常

在不完整类型中目前不支持此方法。This method is not currently supported in types that are not complete.

注解

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

适用于