private void Replace_Click(object sender, RoutedEventArgs e)
{
if (FindText.Text.Length > 0 && FindText.Items != null && (FindText.Items.Count == 0 || (string)FindText.Items[0] != FindText.Text))
{
FindText.Items.Insert(0, FindText.Text);
}
if (replaceall.IsChecked ?? true)
{
mainWindow.ReplaceStringOnPage(FindText.Text, ReplaceText.Text, this.MatchCase.IsChecked ?? true, this.RegexFind.IsChecked ?? true);
mainWindow.FindNextStringOnPage("", false, false, this.MatchCase.IsChecked ?? true, this.RegexFind.IsChecked ?? true);
this.mainWindow.SetStatusText("");
}
else
{
this.mainWindow.ReplaceSelectedText(ReplaceText.Text);
mainWindow.FindNextStringOnPage(FindText.Text, false, false, this.MatchCase.IsChecked ?? true, this.RegexFind.IsChecked ?? true);
}
}