C# FieldInfo ReflectedType
Description
FieldInfo ReflectedType
Gets the class object that was
used to obtain this instance of MemberInfo.
Syntax
FieldInfo.ReflectedType
has the following syntax.
public abstract Type ReflectedType { get; }
Example
using System;//from w w w .j a va 2 s. co m
using System.Reflection;
public class Example
{
static void Main()
{
MemberInfo m1 = typeof(Object).GetMethod("ToString");
MemberInfo m2 = typeof(MemberInfo).GetMethod("ToString");
Console.WriteLine("m1.DeclaringType: {0}", m1.DeclaringType);
Console.WriteLine("m1.ReflectedType: {0}", m1.ReflectedType);
Console.WriteLine();
Console.WriteLine("m2.DeclaringType: {0}", m2.DeclaringType);
Console.WriteLine("m2.ReflectedType: {0}", m2.ReflectedType);
//Console.ReadLine();
}
}
The code above generates the following result.