public BootstrapperInfo([NotNull] Type type, [NotNull] StoveBootstrapper instance) { Type = type; Assembly = Type.Assembly; Instance = instance; Dependencies = new List <BootstrapperInfo>(); }
private void SetDependencies() { foreach (BootstrapperInfo bootstrapperInfo in _bootstrappers) { bootstrapperInfo.Dependencies.Clear(); //Set dependencies for defined DependsOnAttribute attribute(s). foreach (Type dependedBootstrapperType in StoveBootstrapper.FindDependedBootstrapperTypes(bootstrapperInfo.Type)) { BootstrapperInfo dependedBootstrapperInfo = _bootstrappers.FirstOrDefault(m => m.Type == dependedBootstrapperType); if (dependedBootstrapperInfo == null) { throw new StoveInitializationException("Could not find a depended bootstrapper " + dependedBootstrapperType.AssemblyQualifiedName + " for " + bootstrapperInfo.Type.AssemblyQualifiedName); } if (bootstrapperInfo.Dependencies.FirstOrDefault(dm => dm.Type == dependedBootstrapperType) == null) { bootstrapperInfo.Dependencies.Add(dependedBootstrapperInfo); } } } }
private List <Type> FindAllBootstrapperTypes() { List <Type> bootstrappers = StoveBootstrapper.FindDependedBootstrapperTypesRecursivelyIncludingGivenBootstrapper(_bootstrappers.StartupBootstrapperType); return(bootstrappers); }