Example #1
0
 public static void BuildNodesTree(this TreeContext context, Dictionary<IToken, List<INode>> nodeDependencies)
 {
     nodeDependencies.ForNodes(context, node => AssignNode(node, context));
     foreach (var node in context.Tree.Nodes.Values
                                 .Where(x => x != context.Tree.Root)
                                 .Where(x => x.SourceParent == null))
     {
         throw new RegistrationException($"Could not put {node} to the resolution tree, please check registrations.", node.Provider.DiagInfo);
     }
 }
 public static void CalculateNodeWeights(this TreeContext context, Dictionary<IToken, List<INode>> nodeDependencies)
 {
     nodeDependencies.ForNodes(context, node => SetNodeWeights(context, node));
     context.Filters.ForEach(x => x.ForDependencies((dep1, dep2) => SetNodeWeights(context, dep1, dep2)));
 }