예제 #1
0
        internal static IEnumerable <ExtendedModuleInfo> GetExtendedLoadedModulesEnumerable()
        {
            var modulesNames = Utilities.GetModulesNames();

            for (var i = 0; i < modulesNames?.Length; i++)
            {
                var moduleInfo = new ExtendedModuleInfo();
                moduleInfo.Load(modulesNames[i]);
                yield return(moduleInfo);
            }
        }
예제 #2
0
        private static IEnumerable <ExtendedModuleInfo> GetDependentModulesOf(ICollection <ExtendedModuleInfo> source, ExtendedModuleInfo module)
        {
            foreach (var dependedModule in module.DependedModules)
            {
                if (source.FirstOrDefault(i => i.Id == dependedModule.ModuleId) is { } moduleInfo)
                {
                    yield return(moduleInfo);
                }
            }

            foreach (var dependedModuleMetadata in module.DependedModuleMetadatas)
            {
                if (source.FirstOrDefault(i => i.Id == dependedModuleMetadata.Id) is { } moduleInfo&& dependedModuleMetadata.LoadType == LoadType.LoadBeforeThis)
                {
                    yield return(moduleInfo);
                }
            }

            foreach (var moduleInfo in source)
            {
                foreach (var dependedModuleMetadata in moduleInfo.DependedModuleMetadatas)
                {
                    if (dependedModuleMetadata.Id == module.Id && dependedModuleMetadata.LoadType == LoadType.LoadAfterThis)
                    {
                        yield return(moduleInfo);
                    }
                }
            }
        }