Bagikan melalui


DynamicMethod.ReturnType Properti

Definisi

Mendapatkan jenis nilai pengembalian untuk metode dinamis.

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

Nilai Properti

yang Type mewakili jenis nilai yang dikembalikan dari metode saat ini; Void jika metode tidak memiliki jenis pengembalian.

Contoh

Contoh kode berikut menampilkan jenis pengembalian metode dinamis. Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk DynamicMethod kelas .

// If the method has no return type, ReturnType is System.Void.
Console::WriteLine("\r\nReturn type: {0}", hello->ReturnType);
// If the method has no return type, ReturnType is System.Void.
Console.WriteLine("\r\nReturn type: {0}", hello.ReturnType);
' If the method has no return type, ReturnType is System.Void.
Console.WriteLine(vbCrLf & "Return type: {0}", hello.ReturnType)

Keterangan

Jika null ditentukan untuk jenis pengembalian ketika metode dinamis dibuat, properti ini mengembalikan System.Void.

Berlaku untuk