/// <summary> /// Process a line. /// </summary> /// <param name="start">The index of the start of the line</param> /// <param name="line">The line</param> private void ProcessLine(int start, string line) { if (ApplyPatterns) { // Save SelectionStart and SelectionLength because syntax highlighting will change int savedSelectionStart = SelectionStart; int savedSelectionLength = SelectionLength; Color savedSelectionColor = SelectionBackColor; SelectionStart = start; SelectionLength = line.Length; SelectionColor = Color.Black; SelectionFont = RegularFont; Recognizer.Colorize(this, Instance, start, line); SelectionStart = savedSelectionStart; SelectionLength = savedSelectionLength; SelectionColor = savedSelectionColor; } }