EnumBuilder.GetNestedTypes(BindingFlags) EnumBuilder.GetNestedTypes(BindingFlags) EnumBuilder.GetNestedTypes(BindingFlags) EnumBuilder.GetNestedTypes(BindingFlags) Method

定义

返回此类型声明或继承的公共和非公共嵌套类型。Returns the public and non-public nested types that are declared or inherited by this type.

public:
 override cli::array <Type ^> ^ GetNestedTypes(System::Reflection::BindingFlags bindingAttr);
public override Type[] GetNestedTypes (System.Reflection.BindingFlags bindingAttr);
override this.GetNestedTypes : System.Reflection.BindingFlags -> Type[]
Public Overrides Function GetNestedTypes (bindingAttr As BindingFlags) As Type()

参数

bindingAttr
BindingFlags BindingFlags BindingFlags BindingFlags

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

返回

Type[]

Type 对象数组,表示当前 Type 中嵌套的与指定的绑定约束匹配的所有类型。An array of Type objects representing all the types nested within the current Type that match the specified binding constraints.

如果当前 Type 中未嵌套任何类型,或者如果没有一个嵌套类型与绑定约束匹配,则为类型 Type 的空数组。An empty array of type Type, if no types are nested within the current Type, or if none of the nested types match the binding constraints.

异常

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

注解

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

适用于