C# TypeInfo ReflectedType

Description

TypeInfo ReflectedType Gets the class object that was used to obtain this member.

Syntax

TypeInfo.ReflectedType has the following syntax.


public override Type ReflectedType { get; }

Example

This example displays the reflected type of a nested class.


//from   w  ww.  j a  va2s .  c  o  m
using System;
using System.Reflection;

public abstract class MyClassA
{

    public abstract class MyClassB 
    {
    }

    public static void Main(string[] args) 
    { 
        Console.WriteLine("Reflected type of MyClassB is {0}",
            typeof(MyClassB).ReflectedType); //outputs MyClassA, the enclosing class
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Reflection »




EventInfo
FieldInfo
MemberInfo
MethodInfo
ParameterInfo
TypeInfo