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

btnReplacePrevious_Click() private method

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

            this.AddReplacMru();
            this.lblStatus.Text = string.Empty;

            Range nextRange = null;
            try
            {
                nextRange = this.ReplaceNext(true);
            }
            catch (ArgumentException ex)
            {
                this.lblStatus.Text = "Error in Regular Expression: " + ex.Message;
                return;
            }

            if (nextRange == null)
            {
                this.lblStatus.Text = "Match could not be found";
            }
            else
            {
                if (nextRange.Start > this.Scintilla.Caret.Anchor)
                {
                    if (this.chkSearchSelectionR.Checked)
                        this.lblStatus.Text = "Search match wrapped to the begining of the selection";
                    else
                        this.lblStatus.Text = "Search match wrapped to the begining of the document";
                }

                nextRange.Select();
                this.MoveFormAwayFromSelection();
            }
        }