protected virtual bool VisitDependency(T package, Func <T, bool?> dependency) { var result = SuccessfulPackages.Select(dependency) .FirstOrDefault(_ => _ != null); if (result == true) { return(true); } if (result == false) { var incompatible = SuccessfulPackages.First(_ => dependency(_) == false); IncompatiblePackages.Add(incompatible); SuccessfulPackages.Remove(incompatible); return(false); } var matchingPackages = Strategy(Packages .Except(IncompatiblePackages) .Where(_ => dependency(_) == true)) .ToList(); var b = VisitPackages(matchingPackages); return(b); }
protected virtual void NestedPackageFail(PackageResolverVisitor <T> newResolver) { foreach (var package in newResolver.IncompatiblePackages) { IncompatiblePackages.Add(package); } }