예제 #1
0
        private void cmdReplaceAll_Click(object sender, EventArgs e)
        {
            if (0 == cboTextToFind.Text.Trim().Length)
            {
                return;
            }

            if (0 == cboReplaceWith.Text.Trim().Length)
            {
                return;
            }

            AddTextToSearchHistory(cboTextToFind.Text);
            AddTextToReplaceHistory(cboReplaceWith.Text);

            _bMatchCase = chkMatchCase.Checked;
            _bWholeWord = chkWholeWord.Checked;

            int counter = -1;
            int ret;

            do
            {
                ++counter;
                ret = FindAndReplace.Replace(Scripter.ScripterForm.CurrentEditor, cboTextToFind.Text, cboReplaceWith.Text, chkMatchCase.Checked, chkWholeWord.Checked);
            } while (ret != -1);

            string msg = counter.ToString() + " occurences were replaced.";

            UtilSys.MessageBoxInfo(msg);
        }
예제 #2
0
        private void cmdReplace_Click(object sender, EventArgs e)
        {
            if (0 == cboTextToFind.Text.Trim().Length)
            {
                return;
            }

            if (0 == cboReplaceWith.Text.Trim().Length)
            {
                return;
            }

            AddTextToSearchHistory(cboTextToFind.Text);
            AddTextToReplaceHistory(cboReplaceWith.Text);

            _bMatchCase = chkMatchCase.Checked;
            _bWholeWord = chkWholeWord.Checked;

            FindAndReplace.Replace(Scripter.ScripterForm.CurrentEditor, cboTextToFind.Text, cboReplaceWith.Text, chkMatchCase.Checked, chkWholeWord.Checked);
        }