Module.GetTypes Module.GetTypes Module.GetTypes Module.GetTypes Method

定义

返回在此模块中定义的所有类型。Returns all the types defined within this module.

public:
 virtual cli::array <Type ^> ^ GetTypes();
public virtual Type[] GetTypes ();
abstract member GetTypes : unit -> Type[]
override this.GetTypes : unit -> Type[]
Public Overridable Function GetTypes () As Type()

返回

Type[]

一组 Type 类型,其中包含在此实例反映的模块中定义的类型。An array of type Type containing types defined within the module that is reflected by this instance.

异常

无法加载模块中的一个或多个类。One or more classes in a module could not be loaded.

调用方没有所要求的权限。The caller does not have the required permission.

注解

ReflectionTypeLoadException 是特殊的加载异常。ReflectionTypeLoadException is a special load exception. ReflectionTypeLoadException.Types属性包含在模块中定义的并已加载的类型的数组。The ReflectionTypeLoadException.Types property contains the array of types that were defined in the module and were loaded. 此数组可能包含一些空值。This array may contain some null values. ReflectionTypeLoadException.LoaderExceptions属性是一个数组,表示由加载程序引发的异常的异常。The ReflectionTypeLoadException.LoaderExceptions property is an array of exceptions that represent the exceptions that were thrown by the loader. 类数组中的孔对准有例外。The holes in the class array line up with the exceptions.

例如,如果一个类的类初始值设定项引发时出现异常后被加载,TargetInvocationException存储中的相应元素LoaderExceptions数组。For example, if the class initializers of one of the classes throws an exception while it is being loaded, a TargetInvocationException is stored in the corresponding element of the LoaderExceptions array.

备注

如果一个类型已转发到另一个程序集,它不是包含在返回的数组。If a type has been forwarded to another assembly, it is not included in the returned array. 类型转发的信息,请参阅公共语言运行时中的类型转发For information on type forwarding, see Type Forwarding in the Common Language Runtime.

安全性

ReflectionPermission
当前模块的反射权限。Reflection permission for the current module.

适用于

另请参阅