CSharp examples for System:Type
Gets the loadable types.
using System.Threading.Tasks; using System.Text; using System.Reflection; using System.Linq; using System.Collections.Generic; using System;/*w w w .j a va 2 s .com*/ public class Main{ /// <summary> /// Gets the loadable types. /// </summary> /// <param name="assembly">The assembly.</param> /// <returns>Returns an IEnumerable of Types that can be loaded.</returns> /// public static IEnumerable<Type> GetLoadableTypes(this Assembly assembly) { try { return assembly.GetTypes(); } catch(ReflectionTypeLoadException e) { return e.Types.Where(t => t != null); } } }