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. 這個陣列可包含部分 null 值。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. 類型轉送上的資訊,請參閱Common Language Runtime 中的型別轉送For information on type forwarding, see Type Forwarding in the Common Language Runtime.

安全性

ReflectionPermission
在目前模組的反映權限。Reflection permission for the current module.

適用於

另請參閱