Beispiel #1
0
        private int GetQuoteBlocksCount(IList <QuoteMarkMatchingResult> matchingLines)
        {
            int from = matchingLines.IndexOfFirst(it => it.HasQuoteMark);
            int to   = matchingLines.IndexOfLast(it => it.HasQuoteMark);

            if (from == -1 || to == -1)
            {
                return(0);
            }

            int quoteBlocksCount = 0;

            foreach (int i in RangeHelper.Range(from + 1, to))
            {
                if (matchingLines[i - 1].HasQuoteMark &&
                    matchingLines[i].IsTextWithoutQuoteMark)
                {
                    quoteBlocksCount++;
                }
            }

            return(quoteBlocksCount + 1);
        }
Beispiel #2
0
 private static bool IsQuotedTextBetween(int startIndex, int endIndex, IList <QuoteMarkMatchingResult> matchingLines)
 {
     return(RangeHelper.Range(startIndex + 1, endIndex - 1).Any(i => matchingLines[i] == QuoteMarkMatchingResult.VNotEmpty));
 }