public static void ShowDialog(TextEditor editor, int selType, Window pr)
        {
            if (theDialog == null)
            {
                theDialog       = new WinFindReplaceDialog(editor);
                theDialog.Owner = pr;
                theDialog.tabMain.SelectedIndex = selType;
                theDialog.Show();
                theDialog.Activate();
            }
            else
            {
                theDialog.tabMain.SelectedIndex = selType;
                theDialog.Activate();
            }

            if (!editor.TextArea.Selection.IsMultiline)
            {
                theDialog.txtFind.Text = theDialog.txtFind2.Text = editor.TextArea.Selection.GetText();
                theDialog.txtFind.SelectAll();
                theDialog.txtFind2.SelectAll();
                theDialog.txtFind2.Focus();
            }
        }
        public static void ShowDialog(TextEditor editor, int selType, Window pr)
        {
            if (theDialog == null)
            {
                theDialog = new WinFindReplaceDialog(editor);
                theDialog.Owner = pr;
                theDialog.tabMain.SelectedIndex = selType;
                theDialog.Show();
                theDialog.Activate();
            }
            else
            {
                theDialog.tabMain.SelectedIndex = selType;
                theDialog.Activate();
            }

            if (!editor.TextArea.Selection.IsMultiline)
            {
                theDialog.txtFind.Text = theDialog.txtFind2.Text = editor.TextArea.Selection.GetText();
                theDialog.txtFind.SelectAll();
                theDialog.txtFind2.SelectAll();
                theDialog.txtFind2.Focus();
            }
        }
Example #3
0
 private void btnReplace_Click(object sender, RoutedEventArgs e)
 {
     WinFindReplaceDialog.ShowDialog(markEdit.textEditor, 1, this);
 }
        private void Window_Closed(object sender, System.EventArgs e)
        {
            textToFind = txtFind2.Text;
            caseSensitive = (cbCaseSensitive.IsChecked == true);
            wholeWord = (cbWholeWord.IsChecked == true);
            useRegex = (cbRegex.IsChecked == true);
            useWildcards = (cbWildcards.IsChecked == true);
            searchUp = (cbSearchUp.IsChecked == true);

            theDialog = null;
        }