Alsing.Windows.Forms.SyntaxBox.FindReplaceForm.btnReplaceAll_Click C# (CSharp) Method

btnReplaceAll_Click() private method

private btnReplaceAll_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void btnReplaceAll_Click(object sender, EventArgs e)
        {
            string text = cboFind.Text;
            if (text == "")
                return;

            bool found = false;
            foreach (string s in cboFind.Items)
            {
                if (s == text)
                {
                    found = true;
                    break;
                }
            }
            if (!found)
                cboFind.Items.Add(text);

            int x = mOwner.Caret.Position.X;
            int y = mOwner.Caret.Position.Y;
            mOwner.Caret.Position.X = 0;
            mOwner.Caret.Position.Y = 0;
            while (mOwner.SelectNext(cboFind.Text, chkMatchCase.Checked,
                                     chkWholeWord.Checked, chkRegEx.Checked))
            {
                mOwner.ReplaceSelection(cboReplace.Text);
            }

            mOwner.Selection.ClearSelection();
            //	mOwner.Caret.Position.X=x;
            //	mOwner.Caret.Position.Y=y;
            //	mOwner.ScrollIntoView ();

            cboFind.Focus();
        }