DynamicMethod.ReflectedType Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets the class that was used in reflection to obtain the method.

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)

Syntax

Public Overrides ReadOnly Property ReflectedType As Type
public override Type ReflectedType { get; }

Property Value

Type: System..::.Type
Always nullNothingnullptra null reference (Nothing in Visual Basic).

Remarks

This property always returns nullNothingnullptra null reference (Nothing in Visual Basic) for dynamic methods.

Examples

The following code example displays the reflected type of a dynamic method. This code example is part of a larger example provided for the DynamicMethod class.

' For dynamic methods, the reflected type is always Nothing.
If hello.ReflectedType Is Nothing Then
   outputBlock.Text &= "ReflectedType is Nothing." & vbLf
Else
   outputBlock.Text &= String.Format("ReflectedType: {0}", _
       hello.ReflectedType) &vbLf
End If
// For dynamic methods, the reflected type is always null.
if (hello.ReflectedType == null)
{
   outputBlock.Text += "ReflectedType is null." + "\n";
}
else
{
   outputBlock.Text += String.Format("ReflectedType: {0}", hello.ReflectedType) + "\n";
}

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Platforms

Windows Phone

See Also

Reference

DynamicMethod Class

System.Reflection.Emit Namespace