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); }
private void cmdFind_Click(object sender, EventArgs e) { if (0 == cboTextToFind.Text.Trim().Length) { return; } AddTextToSearchHistory(cboTextToFind.Text); _bMatchCase = chkMatchCase.Checked; _bWholeWord = chkWholeWord.Checked; FindAndReplace.Find(Scripter.ScripterForm.CurrentEditor, cboTextToFind.Text, chkMatchCase.Checked, chkWholeWord.Checked); }