System.Reflection.Assembly.GetAssembly C# (CSharp) Method

GetAssembly() private method

private GetAssembly ( Type type ) : Assembly
type Type
return Assembly
        public static extern Assembly GetAssembly(Type type);

Usage Example

Esempio n. 1
0
        }                                 // @formatter:on

        // -------------------------------------------------------- GetEnumerableOfType()
        // -- GetEnumerableOfType() -----------------------------------------------------
        public static IEnumerable <T> GetEnumerableOfType <T>(params object[] constructorArgs) where T : class, IComparable <T>
        {
            var objects = new List <T>();

            foreach (var type in Assembly.GetAssembly(typeof(T)).GetTypes().Where(myType => myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(T))))
            {
                objects.Add((T)Activator.CreateInstance(type, constructorArgs));
            }

            objects.Sort();
            return(objects);
        }
All Usage Examples Of System.Reflection.Assembly::GetAssembly