withSIX.Sync.Core.Packages.PackageManager.GetObjectsToFetch C# (CSharp) Method

GetObjectsToFetch() private method

private GetObjectsToFetch ( bool skipWhenFileMatches, IReadOnlyCollection packages, List allRemotes ) : Package.ObjectMap[]
skipWhenFileMatches bool
packages IReadOnlyCollection
allRemotes List
return Package.ObjectMap[]
        private Package.ObjectMap[] GetObjectsToFetch(bool skipWhenFileMatches, IReadOnlyCollection<Package> packages,
            List<Uri> allRemotes) {
            var objects = new List<Package.ObjectMap>();
            var j = 0;
            foreach (var package in packages) {
                var name = package.MetaData.GetFullName();
                var remotes = FindRemotesWithPackage(name).ToArray();
                Console.WriteLine(string.Empty);
                if (!remotes.Any())
                    throw new NoSourceFoundException("No source found with " + name);
                allRemotes.AddRange(remotes);
                Repository.Log("Processing package: {0}", name);
                objects.AddRange(package.GetNeededObjects(skipWhenFileMatches));
            }

            return objects.GroupBy(x => x.FO.Checksum).Select(x => x.First()).ToArray();
        }