private IDependencyResolverPolicy DoGetResolverPolicy(ConcatenationNode node) { var children = node.Children.Select <LateBindingNode, dynamic>(child => { var stringNode = child as StringNode; if (stringNode != null) { return(stringNode.Literal); } return(DoGetResolverPolicy((IndexAccessorNode)child)); }).ToArray(); return(new StringConcatenationResolverPolicy(children)); }
/// <summary> /// Parses the configuration and builds the corresponding <see cref="LateBindingNode"/>. /// </summary> /// <returns>a node representing the AST of the configuration</returns> public LateBindingNode Parse() { LateBindingNode currentNode = null; foreach (var node in ParseTokens()) { if (currentNode == null) { currentNode = node; continue; } var concatenationNode = currentNode as ConcatenationNode; if (concatenationNode != null) { concatenationNode.Add(node); } else { currentNode = new ConcatenationNode(currentNode, node); } } return currentNode; }
/// <summary> /// Parses the configuration and builds the corresponding <see cref="LateBindingNode"/>. /// </summary> /// <returns>a node representing the AST of the configuration</returns> public LateBindingNode Parse() { LateBindingNode currentNode = null; foreach (var node in ParseTokens()) { if (currentNode == null) { currentNode = node; continue; } var concatenationNode = currentNode as ConcatenationNode; if (concatenationNode != null) { concatenationNode.Add(node); } else { currentNode = new ConcatenationNode(currentNode, node); } } return(currentNode); }