Exemple #1
0
        /// <summary>
        /// Returns all types that derive or have a base type of a this type.
        /// </summary>
        public static Type[] Derived(this HUMType.Data.Get derived)
        {
            List <Type> result = new List <Type>();

            Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();

            for (int assembly = 0; assembly < assemblies.Length; assembly++)
            {
                Type[] types = assemblies[assembly].GetTypes();

                for (int type = 0; type < types.Length; type++)
                {
                    if (!types[type].IsAbstract && derived.type.IsAssignableFrom(types[type]))
                    {
                        result.Add(types[type]);
                    }
                }
            }

            return(result.ToArray());
        }
Exemple #2
0
 /// <summary>
 /// Continues the get operation by getting types of some kind.
 /// </summary>
 public static HUMType.Data.Types Types(this HUMType.Data.Get get)
 {
     return(new HUMType.Data.Types(get));
 }