DynamicMethod.ReflectedType 屬性

定義

取得用於反映中以取得方法的類別。

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

屬性值

一定是 null

範例

下列程式代碼範例會顯示動態方法的反映類型。 此程式代碼範例是針對 類別提供的較大範例的 DynamicMethod 一部分。

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

備註

這個屬性一律會 null 針對動態方法傳回 。

適用於