Catel.Reflection.TypeCache.GetTypes C# (CSharp) Метод

GetTypes() публичный статический Метод

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.
Результат System.Type[]
        public static Type[] GetTypes(Func<Type, bool> predicate = null)
        {
            return GetTypesPrefilteredByAssembly(null, predicate);
        }

Usage 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();
        }
All Usage Examples Of Catel.Reflection.TypeCache::GetTypes