public IEnumerable<PipeOutputPackage> SiblingPackageLateBounded(ISemanticRegistryObserver siblingObserver) { var additionalPackages = from historicalPackage in _historicalPackages let siblingPackages = siblingObserver.PipePackageInstalled(historicalPackage) where siblingPackages != null select siblingPackages; return additionalPackages.SelectMany(x => x); }
public IEnumerable <PipeOutputPackage> SiblingPackageLateBounded(ISemanticRegistryObserver siblingObserver) { var additionalPackages = from historicalPackage in _historicalPackages let siblingPackages = siblingObserver.PipePackageInstalled(historicalPackage) where siblingPackages != null select siblingPackages; return(additionalPackages.SelectMany(x => x)); }
public IEnumerable <PipeOutputPackage> PipePackageInstalled(PipeOutputPackage package) { var key = new Tuple <Type, Type>(package.InputType, package.OutputType); PipeOutputPackage rememberedPackage; bool hasEncounteredPackageBefore = _packages.TryGetValue(key, out rememberedPackage); if (!hasEncounteredPackageBefore) { _packages.Add(key, package); } if (!hasEncounteredPackageBefore || package.Weight < rememberedPackage.Weight) { return(_wrappedObserver.PipePackageInstalled(package)); } return(null); }