Share via


DynamicMethod.ReflectedType Properti

Definisi

Mendapatkan kelas yang digunakan dalam refleksi untuk mendapatkan metode .

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

Nilai Properti

Selalu null.

Contoh

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

// For dynamic methods, the reflected type is always null.
if (hello->ReflectedType == nullptr)
{
    Console::WriteLine("\r\nReflectedType is null.");
}
else
{
    Console::WriteLine("\r\nReflectedType: {0}", hello->ReflectedType);
}
// For dynamic methods, the reflected type is always null.
if (hello.ReflectedType == null)
{
    Console.WriteLine("\r\nReflectedType is null.");
}
else
{
    Console.WriteLine("\r\nReflectedType: {0}", hello.ReflectedType);
}
' For dynamic methods, the reflected type is always Nothing.
If hello.ReflectedType Is Nothing Then
    Console.WriteLine(vbCrLf & "ReflectedType is Nothing.")
Else
    Console.WriteLine(vbCrLf & "ReflectedType: {0}", _
        hello.ReflectedType)
End If

Keterangan

Properti ini selalu kembali null untuk metode dinamis.

Berlaku untuk