Пример #1
0
        private Func<string, bool> ChainPredicate(Func<string, bool> predicate, GraphItem<RemoteResolveResult> item, LibraryDependency dependency)
        {
            return name =>
                {
                    if (item.Data.Match.Library.Name == name)
                    {
                        throw new Exception(string.Format("Circular dependency references not supported. Package '{0}'.", name));
                    }

                    if (item.Data.Dependencies.Any(d => d != dependency && d.Name == name))
                    {
                        return false;
                    }

                    return predicate(name);
                };
        }
Пример #2
0
        private static string GetChain(GraphNode<Library> node, LibraryDependency dependency)
        {
            var result = dependency.Name;
            var current = node;

            while (current != null)
            {
                result = current.Key.Name + " -> " + result;
                current = current.OuterNode;
            }

            return result;
        }