Exemplo n.º 1
0
        static bool Painter(ref int CurrentIndex, ref int Index001, ref int Index002)
        {
            //Текущий видимый индекс
            int CurrentVisibleTextIndex;

            //Сравниваем итоговый индекс маркера с итератором
            //Закрашиваем область
            if (CheckList(ref MarkIndexes, Index001) && CheckList(ref TextSortedIndexes, Index002))
            {
                //Вычисляем видимый индекс закрашиваемого слова
                CurrentVisibleTextIndex = TextSortedIndexes[Index002] - TextVertBorders.Primis + TextVertKoord;
                if (MarkIndexes[Index001] == CurrentVisibleTextIndex && CurrentVisibleTextIndex == CurrentIndex)
                {
                    ColorizeAll(CurrentVisibleTextIndex, PaintBackGrHorizKoords);
                    ++Index001;
                    ++Index002;
                    return(true);
                }
            }
            if (CheckList(ref MarkIndexes, Index001))
            //if (MarkIndexes.Any() && Index001 < MarkIndexes.Count && !WasPainted)
            {
                if (MarkIndexes[Index001] == CurrentIndex)
                {
                    ColorizePartLine(MarkIndexes[Index001], PaintBackGrHorizKoords);
                    ++Index001;
                    return(true);
                }
            }
            if (CheckList(ref TextSortedIndexes, Index002))
            //if (TextIndexes.Any() && Index002 < TextIndexes.Count && !WasPainted)
            {
                if (MyFunc.IntraAream(TextSortedIndexes[Index002], TextVertBorders.Primis, TextVertBorders.Secundus - 1) == 0)
                {
                    //Вычисляем видимый индекс закрашиваемого слова
                    CurrentVisibleTextIndex = TextSortedIndexes[Index002] - TextVertBorders.Primis + TextVertKoord;
                    if (CurrentVisibleTextIndex == CurrentIndex)
                    {
                        ColorizeWord(CurrentVisibleTextIndex, TextHorizontalKoords);
                        ++Index002;
                        return(true);
                    }
                }
            }
            return(false);
        }