AutoWikiBrowser.MainForm.RedSelection C# (CSharp) Method

RedSelection() private method

private RedSelection ( int index, int length ) : void
index int
length int
return void
        private void RedSelection(int index, int length)
        {
            if (!txtEdit.Enabled)
                return;

            // numbers in articleText and txtEdit.Edit are offset by the number of newlines before the index of the text
            int newlinesToIndex = WikiRegexes.Newline.Matches(txtEdit.Text.Substring(0, index)).Count;
            int newlinesInSelection = WikiRegexes.Newline.Matches(txtEdit.Text.Substring(index, length)).Count;
            txtEdit.SetEditBoxSelection(index - newlinesToIndex, length - newlinesInSelection, false);
            txtEdit.SelectionBackColor = Color.Tomato;
        }
MainForm