StonehearthEditor.FilePreview.indicate C# (CSharp) Method

indicate() private method

Helper used in restyleDocument
private indicate ( string pattern, System.Action targetTransform = null ) : void
pattern string
targetTransform System.Action
return void
        private void indicate(string pattern, Action targetTransform = null)
        {
            textBox.TargetWholeDocument();

            while (textBox.SearchInTarget(pattern) != -1)
            {
                // Invoke transformation, if any was submitted
                targetTransform?.Invoke();

                // Only indicate if there's something to indicate
                if (textBox.TargetStart != textBox.TargetEnd)
                    textBox.IndicatorFillRange(textBox.TargetStart, textBox.TargetEnd - textBox.TargetStart);
                textBox.TargetStart = textBox.TargetEnd;
                textBox.TargetEnd = textBox.TextLength;
            }
        }