Edit

Kongsi melalui


ModuleBuilder.GetTypes Method

Definition

Returns all the classes defined within this module.

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

Returns

Type[]

An array that contains the types defined within the module that is reflected by this instance.

Exceptions

One or more classes in a module could not be loaded.

The caller does not have the required permission.

Remarks

ReflectionTypeLoadException is a special class load exception. The ReflectionTypeLoadException.Types property contains the array of classes that were defined in the module and loaded. This array can contain some null values. The ReflectionTypeLoadException.LoaderExceptions property is an array of exceptions that represent the exceptions that were thrown by the class loader. The holes in the class array line up with the exceptions.

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.

Note

Starting with the .NET Framework 2.0 Service Pack 1, this member no longer requires ReflectionPermission with the ReflectionPermissionFlag.ReflectionEmit flag. (See Security Issues in Reflection Emit.) To use this functionality, your application should target the .NET Framework 3.5 or later.

Applies to

See also