DynamicMethod.ReflectedType Właściwość

Definicja

Pobiera klasę użytą w odbiciu w celu uzyskania metody .

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

Wartość właściwości

Zawsze wartość null.

Przykłady

Poniższy przykład kodu przedstawia odzwierciedlonego typu metody dynamicznej. Ten przykład kodu jest częścią większego przykładu udostępnionego DynamicMethod dla klasy .

// 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

Uwagi

Ta właściwość zawsze zwraca wartość null dla metod dynamicznych.

Dotyczy