Esempio n. 1
0
 private static int CompareLineMatch(LineMatch x, LineMatch y)
 {
     if (x.lineNo != y.lineNo)
     {
         return(x.lineNo - y.lineNo);
     }
     return(x.Match.Index - y.Match.Index);
 }
Esempio n. 2
0
        private bool isInRange(int currentLineNo, Match m)
        {
            //今の行番に一番近い先頭行を取得
            LineMatch fromMatch = keys.FindLast(fm => (fm.lineNo == currentLineNo && fm.Match.Index <= m.Index) || fm.lineNo < currentLineNo);

            if (fromMatch != null)
            {
                //先頭行対応する直後行を取得
                LineMatch toMatch = vals.Find(tm => (fromMatch.lineNo == tm.lineNo && fromMatch.Match.Index <= tm.Match.Index) ||
                                              fromMatch.lineNo < tm.lineNo);
                if (toMatch != null)
                {
                    if (toMatch.lineNo > currentLineNo)
                    {
                        return(true);
                    }
                    else if (toMatch.lineNo == currentLineNo && toMatch.Match.Index >= m.Index)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }