Example #1
0
        private readonly LamedalCore_ _lamed = LamedalCore_.Instance;  // Create new instance of the blueprint library

        /// <summary>
        /// Assembly_Get gets the all from remove system assemblies indicator. Default value = true..
        /// </summary>
        /// <param name="filterAssemblies">Remove system assemblies indicator. Default value = true.</param>
        /// <param name="filters">The filters.</param>
        /// <returns>
        /// List<Assembly_Get />
        /// </returns>
        public List <Assembly> Get_All(bool filterAssemblies = true, stateAssemblyFilters filters = null)
        {
            Assembly[]      assemblyArray = AppDomain.CurrentDomain.GetAssemblies();
            List <Assembly> assemblies    = assemblyArray.Where(x => x.IsDynamic == false).zUnique2().ToList();

            if (filterAssemblies == false)
            {
                return(assemblies);
            }
            if (filters == null)
            {
                filters = new stateAssemblyFilters();
            }

            var assemblies2 = new List <Assembly>();

            foreach (Assembly assembly1 in assemblies)
            {
                //string name = assembly1.FullName.zvar_Id(" ");
                if (assembly1.GlobalAssemblyCache)
                {
                    continue;                                  // Ignore GAC assemblies
                }
                if (assembly1.Location.zContains_Any(filters.FilterOut_Locations))
                {
                    continue;
                }
                if (assembly1.FullName.zContains_Any(filters.FilterOut_Names))
                {
                    continue;
                }
                assemblies2.Add(assembly1);
            }

            return(assemblies2);
        }
Example #2
0
        /// <summary>
        /// Assembly_Get gets the all from remove system assemblies indicator. Default value = true..
        /// </summary>
        /// <param name="assemblyNames">The assembly names.</param>
        /// <param name="filterAssemblies">Remove system assemblies indicator. Default value = true.</param>
        /// <param name="filters">The filters.</param>
        /// <returns>
        /// List<Assembly_Get />
        /// </returns>
        public IList <Assembly> Get_All(out IList <string> assemblyNames, bool filterAssemblies = true, stateAssemblyFilters filters = null)
        {
            var result = Get_All(filterAssemblies, filters);

            assemblyNames = result.Select(x => x.FullName.zvar_Id(" ")).ToList();
            assemblyNames = assemblyNames.zUnique();
            return(result);
        }