private Range FindNextF(bool searchUp)
{
Range foundRange;
if (this.rdoRegexF.Checked)
{
var rr = new Regex(this.cboFindF.Text, this.GetRegexOptions());
if (this.chkSearchSelectionF.Checked)
{
if (this._searchRange == null)
this._searchRange = this.Scintilla.Selection.Range;
if (searchUp)
foundRange = this.Scintilla.FindReplace.FindPrevious(rr, this.chkWrapF.Checked, this._searchRange);
else
foundRange = this.Scintilla.FindReplace.FindNext(rr, this.chkWrapF.Checked, this._searchRange);
}
else
{
this._searchRange = null;
if (searchUp)
foundRange = this.Scintilla.FindReplace.FindPrevious(rr, this.chkWrapF.Checked);
else
foundRange = this.Scintilla.FindReplace.FindNext(rr, this.chkWrapF.Checked);
}
}
else
{
if (this.chkSearchSelectionF.Checked)
{
if (this._searchRange == null)
this._searchRange = this.Scintilla.Selection.Range;
if (searchUp)
foundRange = this.Scintilla.FindReplace.FindPrevious(this.cboFindF.Text, this.chkWrapF.Checked, this.GetSearchFlags(), this._searchRange);
else
foundRange = this.Scintilla.FindReplace.FindNext(this.cboFindF.Text, this.chkWrapF.Checked, this.GetSearchFlags(), this._searchRange);
}
else
{
this._searchRange = null;
if (searchUp)
foundRange = this.Scintilla.FindReplace.FindPrevious(this.cboFindF.Text, this.chkWrapF.Checked, this.GetSearchFlags());
else
foundRange = this.Scintilla.FindReplace.FindNext(this.cboFindF.Text, this.chkWrapF.Checked, this.GetSearchFlags());
}
}
return foundRange;
}