Assembly.GetExportedTypes Method

Gets the types defined in this assembly that are visible outside the assembly.

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

public virtual Type[] GetExportedTypes()

Return Value

Type: System.Type[]
An array of Type objects that represent the types defined in this assembly that are visible outside the assembly.

The only types visible outside an assembly are public types and public types nested within other public types.

The following code sample defines a number of classes with various access levels, and calls GetExportedTypes to display the ones that are visible from outside the assembly.


using System;
using System.Reflection;

public class Example
{
   public static void Demo(System.Windows.Controls.TextBlock outputBlock)
   {
      foreach (Type t in Assembly.GetExecutingAssembly().GetExportedTypes())
      {
         outputBlock.Text += t + "\n";
      }
   }
}

public class PublicClass
{
   public class PublicNestedClass { }

   protected class ProtectedNestedClass { }

   internal class FriendNestedClass { }

   private class PrivateNestedClass { }
}

internal class FriendClass
{
   public class PublicNestedClass { }

   protected class ProtectedNestedClass { }

   internal class FriendNestedClass { }

   private class PrivateNestedClass { }
}


Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: