ARCed.Scintilla.FindReplace.ReplaceAllEvaluator C# (CSharp) Method

ReplaceAllEvaluator() private method

private ReplaceAllEvaluator ( Match m ) : string
m System.Text.RegularExpressions.Match
return string
        private string ReplaceAllEvaluator(Match m)
        {
            //	So this method is called for every match

            //	We make a replacement in the range based upon
            //	the match range.
            string replacement = m.Result(_lastReplaceAllReplaceString);
            int start = _lastReplaceAllRangeToSearch.Start + m.Index + _lastReplaceAllOffset;
            int end = start + m.Length;

            Range r = new Range(start, end, Scintilla);
            _lastReplaceAllMatches.Add(r);
            r.Text = replacement;

            //	But because we've modified the document, the RegEx
            //	match ranges are going to be different from the
            //	document ranges. We need to compensate
            _lastReplaceAllOffset += replacement.Length - m.Value.Length;
            return replacement;
        }