C# Type ReflectedType

Description

Type ReflectedType gets the class object that was used to obtain this member.

Syntax

Type.ReflectedType has the following syntax.


public override Type ReflectedType { get; }

Example

This example displays the reflected type of a nested class.


//  ww  w  .  j  ava  2 s .c om

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 »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version