public override void Visit(CycleNode node)
 {
   BeginNonTextNode();
   var cycle = new CycleNode(node.Id);
   cycle.Body = VisitBranch(node.Body);
   cycle.EmptyCase = VisitBranch(node.EmptyCase);
   cycle.Delimiter = node.Delimiter;
   AppendNode(cycle);
   EndNonTextNode();
 }
Exemple #2
0
        public SqlCompilerOutputScope EnterCycleBodyScope(object id, string delimiter)
        {
            var cycle = new CycleNode(id)
            {
                Body      = new ContainerNode(),
                EmptyCase = new ContainerNode(),
                Delimiter = delimiter
            };

            Output.Add(cycle);
            return(OpenScope(ContextType.Collection, (ContainerNode)cycle.Body));
        }
        public override void Visit(CycleNode node)
        {
            List <string[]> items;

            if (!configuration.DynamicFilterValues.TryGetValue(node.Id, out items))
            {
                throw new InvalidOperationException(string.Format(Strings.ExItemsForCycleXAreNotSpecified, node.Id));
            }
            if (items == null || items.Count == 0)
            {
                VisitNodeSequence(node.EmptyCase);
                return;
            }
            for (int i = 0; i < items.Count - 1; i++)
            {
                currentCycleItem = items[i];
                VisitNodeSequence(node.Body);
                result.Append(node.Delimiter);
            }
            currentCycleItem = items[items.Count - 1];
            VisitNodeSequence(node.Body);
        }
 public virtual void Visit(CycleNode node)
 {
     throw new InvalidOperationException();
 }