Example #1
0
        private void highlightPronounText(Pronoun p)
        {
            essayTextBox.shouldRun = false;
            int sentence = p.getSentence();
            int start    = essay.getSpan(sentence, p.getTokenStart()).getStart() + this.sentenceStarts[sentence];
            int length   = essay.getSpan(sentence, p.getTokenStart() + p.getLength() - 1).getEnd() - start + this.sentenceStarts[sentence];

            essayTextBox.Select(start, length);
            essayTextBox.SelectionColor = Color.Black;
            Color c;

            switch (p.getPerson())
            {
            case 1:
                if (p.getNumber() == 0)
                {
                    c = Color.FromArgb(255, 234, 175);
                    break;
                }
                else
                {
                    c = Color.FromArgb(255, 228, 151);
                    break;
                }

            case 2:
                c = Color.FromArgb(212, 216, 252);
                break;

            case 3:
                if (p.getNumber() == 0)
                {
                    c = Color.FromArgb(255, 208, 209);
                    break;
                }
                else
                {
                    c = Color.FromArgb(255, 175, 177);
                    break;
                }

            default:
                c = Color.White;
                break;
            }

            essayTextBox.SelectionBackColor = c;
            essayTextBox.shouldRun          = true;
        }
Example #2
0
 private void highlightPronounText(Pronoun l)
 {
     essayTextBox.Select(l.getStart(), l.getLength());
     essayTextBox.SelectionColor     = Color.Black;
     essayTextBox.SelectionBackColor = l.getColor();
 }