ARCed.Scintilla.FindReplaceDialog.btnFindAll_Click C# (CSharp) Method

btnFindAll_Click() private method

private btnFindAll_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void btnFindAll_Click(object sender, EventArgs e)
        {
            if (this.cboFindF.Text == string.Empty)
                return;

            this.AddFindMru();

            this.lblStatus.Text = string.Empty;

            List<Range> foundRanges = null;
            if (this.rdoRegexF.Checked)
            {
                Regex rr = null;
                try
                {
                    rr = new Regex(this.cboFindF.Text, this.GetRegexOptions());
                }
                catch (ArgumentException ex)
                {
                    this.lblStatus.Text = "Error in Regular Expression: " + ex.Message;
                    return;
                }

                if (this.chkSearchSelectionF.Checked)
                {
                    if (this._searchRange == null)
                    {
                        this._searchRange = this.Scintilla.Selection.Range;
                    }

                    foundRanges = this.Scintilla.FindReplace.FindAll(this._searchRange, rr);
                }
                else
                {
                    this._searchRange = null;
                    foundRanges = this.Scintilla.FindReplace.FindAll(rr);
                }
            }
            else
            {
                if (this.chkSearchSelectionF.Checked)
                {
                    if (this._searchRange == null)
                        this._searchRange = this.Scintilla.Selection.Range;

                    foundRanges = this.Scintilla.FindReplace.FindAll(this._searchRange, this.cboFindF.Text, this.GetSearchFlags());
                }
                else
                {
                    this._searchRange = null;
                    foundRanges = this.Scintilla.FindReplace.FindAll(this.cboFindF.Text, this.GetSearchFlags());
                }
            }

            this.lblStatus.Text = "Total found: " + foundRanges.Count.ToString();

            this.btnClear_Click(null, null);

            if (this.chkMarkLine.Checked)
                this.Scintilla.FindReplace.MarkAll(foundRanges);

            if (this.chkHighlightMatches.Checked)
                this.Scintilla.FindReplace.HighlightAll(foundRanges);
        }