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. @No__t-0 屬性包含已在模組中定義且已載入的類型陣列。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. @No__t-0 屬性是一種例外狀況陣列,代表載入器所擲回的例外狀況。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.

適用於

另請參閱