DynamicMethod.Module 屬性

定義

取得動態方法在邏輯上相關聯的模組。

public:
 virtual property System::Reflection::Module ^ Module { System::Reflection::Module ^ get(); };
public override System.Reflection.Module Module { get; }
member this.Module : System.Reflection.Module
Public Overrides ReadOnly Property Module As Module

屬性值

與目前的動態方法關聯的 Module

範例

下列程式代碼範例會顯示 Module 動態方法的 屬性。 此程式代碼範例是提供給 類別之較大範例的 DynamicMethod 一部分。

// Display the module specified when the dynamic method was created.
Console::WriteLine("\r\nModule: {0}", hello->Module);
// Display the module specified when the dynamic method was created.
Console.WriteLine("\r\nModule: {0}", hello.Module);
' Display the module specified when the dynamic method was created.
Console.WriteLine(vbCrLf & "Module: {0}", hello.Module)

備註

如果在建立動態方法時指定了模組,則此屬性會傳回該模組。 如果在建立動態方法時將類型指定為擁有者,則此屬性會傳回包含該類型的模組。

適用於