GetTypes() public static method

Gets all the types from the current AppDomain where the predicate returns true.
The is null.
public static GetTypes ( bool>.Func predicate = null ) : System.Type[]
predicate bool>.Func The predicate where the type should apply to.
return System.Type[]
Example #1
0
        /// <summary>
        /// Gets a list of all types inside the <see cref="AppDomain"/>.
        /// </summary>
        /// <param name="appDomain">The app domain.</param>
        /// <returns>List of types found in the <see cref="AppDomain"/>.</returns>
        /// <remarks>
        /// This class must only be used by Catel. To make sure that an application performs, make sure to use
        /// <see cref="TypeCache.GetTypes"/> instead.
        /// </remarks>
        internal static Type[] GetTypes(this AppDomain appDomain)
        {
            Argument.IsNotNull("appDomain", appDomain);

            return(TypeCache.GetTypes());

            //List<Assembly> assemblies = AssemblyHelper.GetLoadedAssemblies(appDomain);
            //var types = new List<Type>();

            //foreach (var assembly in assemblies)
            //{
            //    types.AddRange(from assemblyType in AssemblyHelper.GetAllTypesSafely(assembly)
            //                   select assemblyType);
            //}

            //return types.ToArray();
        }
Example #2
0
        /// <summary>
        /// Gets a list of all types inside the <see cref="AppDomain"/>.
        /// </summary>
        /// <param name="appDomain">The app domain.</param>
        /// <returns>List of types found in the <see cref="AppDomain"/>.</returns>
        /// <remarks>
        /// This class must only be used by Catel. To make sure that an application performs, make sure to use
        /// <see cref="TypeCache.GetTypes"/> instead.
        /// </remarks>
        internal static Type[] GetTypes(this AppDomain appDomain)
        {
            Argument.IsNotNull("appDomain", appDomain);

            return(TypeCache.GetTypes());
        }