Reflection on nested Types

In this chapter you will learn:

  1. Obtaining nested types

Obtaining nested types

To retrieve nested types, call GetNestedTypes on the containing type. For example:

using System;//from   ja v a 2  s . com
using System.Reflection;
using System.Collections.Generic;

class MainClass
{
    static void Main()
    {
        foreach (Type t in typeof(System.Environment).GetNestedTypes())
            Console.WriteLine(t.FullName);
    }
}

The output:

Next chapter...

What you will learn in the next chapter:

  1. Is object a type
Home » C# Tutorial » Reflection
Reflection
Type
Type properties
Field reflection
Field Type
Field Attributes
FieldHandle
Field value
Set Field value
delegate reflection
Event reflection
Indexer reflection
Properties Reflection
Method
Parameter
Invoke
Type Instantiating
interface reflection
Generic type reflection
Reflection on nested Types
Subtype
Array reflection
Assembly