コード例 #1
0
        private void SetDependencies()
        {
            foreach (var moduleInfo in _moduleList)
            {
                moduleInfo.Dependencies.Clear();

                //Set dependencies for defined DependsOnAttribute attribute(s).
                foreach (var dependedModuleType in JulyModule.FindDependedModuleTypes(moduleInfo.Type))
                {
                    var dependedModuleInfo = _moduleList.FirstOrDefault(m => m.Type == dependedModuleType);
                    if (dependedModuleInfo == null)
                    {
                        throw new InvalidOperationException("Could not find a depended module " + dependedModuleType.AssemblyQualifiedName + " for " + moduleInfo.Type.AssemblyQualifiedName);
                    }

                    if ((moduleInfo.Dependencies.FirstOrDefault(dm => dm.Type == dependedModuleType) == null))
                    {
                        moduleInfo.Dependencies.Add(dependedModuleInfo);
                    }
                }
            }
        }
コード例 #2
0
        private List <Type> FindAllModuleTypes()
        {
            var modules = JulyModule.FindDependedModuleTypesRecursivelyIncludingGivenModule(_moduleList.StartupModuleType);

            return(modules);
        }