SearchTextBox.cs
/// <summary>
/// Finds the next match for 'SearchString.
/// </summary>
/// <returns> the line number the match occured on</returns>
Finds the next match for 'SearchString.
Finds the next match for ' SearchString .
public int FindPrevMatch()
        {
            int retVal = -1;
            if (SearchString != null && !SearchString.Equals(""))
            {
                Regex r = new Regex(SearchString, RegexOptions.IgnoreCase);
                MatchCollection mc = r.Matches(this.Text);
                Match m = null;
                if (mc.Count > 0)
                    m = mc[mc.Count - 1];
                else
                    goto end;
                int i = 0;
                while (mc[i].Index < this.SelectionStart - mc[i].Length)
                    m = mc[i++];
                if (m != null && m.Length != 0)
                {
                    this.SelectionStart = m.Index + m.Length;
                    retVal = this.GetLineFromCharIndex(this.SelectionStart);
                }
            }
        end:
            UpdateStatusControl(retVal);
            return retVal;
        }
public int FindPrevMatch ( ) { int retVal = - 1 ; if ( SearchString != null && ! SearchString . Equals ( " " ) ) { Regex r = new Regex ( SearchString , RegexOptions . IgnoreCase ) ; MatchCollection mc = r . Matches ( this . Text ) ; Match m = null ; if ( mc . Count > 0 ) m = mc [ mc . Count - 1 ] ; else goto end ; int i = 0 ; while ( mc [ i ] . Index < this . SelectionStart - mc [ i ] . Length ) m = mc [ i ++ ] ; if ( m != null && m . Length != 0 ) { this . SelectionStart = m . Index + m . Length ; retVal = this . GetLineFromCharIndex ( this . SelectionStart ) ; } } end : UpdateStatusControl ( retVal ) ; return retVal ; }
Finds the next match for 'SearchString.
Finds the next match for ' SearchString .
the line number the match occured on
the line number the match occured on