Get All Exported Types Enum - CSharp System

CSharp examples for System:Type

Description

Get All Exported Types Enum

Demo Code


using System.Web.Mvc;
using System.Web;
using System.Reflection;
using System.Linq;
using System.Collections.Generic;
using System.Collections;
using System;//from  w w w .j a v a  2  s  .  c o  m

public class Main{
        public static IEnumerable<Type> GetAllExportedTypesEnum()
        {
            List<Type> result = new List<Type>();
            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
            {
                result.AddRange(GetExportedTypesEnum(assembly));
            }
            return result;
        }
}

Related Tutorials