internal bool TryGetNext(out TemplateLine line, TemplateLineEvaluationResult lastResult)
 {
     bool result = false;
     line = null;
     if(lastLine != null && lastLine.HasRepeatFlag && lastResult != null)
     {
         if(lastResult.EscapeRepeat == true)
         {
             index++;
             line = GetLineForIndex();
         }
         else
         {
             line = lastLine;
         }
     }
     else
     {
         index++;
         line = GetLineForIndex();
     }
     if (line != null)
         result = true;
     return result;
 }
示例#2
0
        internal bool TryGetNext(out TemplateLine line, TemplateLineEvaluationResult lastResult)
        {
            bool result = false;

            line = null;
            if (lastLine != null && lastLine.HasRepeatFlag && lastResult != null)
            {
                if (lastResult.EscapeRepeat == true)
                {
                    index++;
                    line = GetLineForIndex();
                }
                else
                {
                    line = lastLine;
                }
            }
            else
            {
                index++;
                line = GetLineForIndex();
            }
            if (line != null)
            {
                result = true;
            }
            return(result);
        }
        TemplateLine GetLineForIndex()
        {
            if (index < templateLines.Length)
            {
                string nextLineValue = null;
                if ((index + 1) < templateLines.Length)
                    nextLineValue = templateLines[index + 1];

                TemplateLine line = new TemplateLine(index + 1, templateLines[index], nextLineValue);
                lastLine = line;
                return line;
            }
            else
                lastLine = null;
                return null;
        }
示例#4
0
        TemplateLine GetLineForIndex()
        {
            if (index < templateLines.Length)
            {
                string nextLineValue = null;
                if ((index + 1) < templateLines.Length)
                {
                    nextLineValue = templateLines[index + 1];
                }

                TemplateLine line = new TemplateLine(index + 1, templateLines[index], nextLineValue);
                lastLine = line;
                return(line);
            }
            else
            {
                lastLine = null;
            }
            return(null);
        }