Пример #1
0
        public override void Execute()
        {
            ReplaceDialog.CloseIfOpen();
            FindInFilesDialog.CloseIfOpen();
            FindDialog findDialog = FindDialog.GetFindDialog(this.FindReplaceModel, this.TextEditor, this.MessageDisplayService);

            if (!this.TextEditor.IsSelectionEmpty)
            {
                string text = this.TextEditor.GetText(this.TextEditor.SelectionStart, this.TextEditor.SelectionLength);
                if (!string.IsNullOrEmpty(text) && text.IndexOf('\n') == -1)
                {
                    findDialog.FindText = text;
                }
            }
            findDialog.Show();
        }
Пример #2
0
        public override void Execute()
        {
            ReplaceDialog.CloseIfOpen();
            FindInFilesDialog.CloseIfOpen();
            FindDialog findDialog = FindDialog.GetFindDialog(this.FindReplaceModel, this.TextEditor, this.MessageDisplayService);

            if (string.IsNullOrEmpty(findDialog.FindText))
            {
                findDialog.SearchReverse = false;
                findDialog.Show();
            }
            else
            {
                if (!findDialog.FindNext())
                {
                    return;
                }
                this.TextEditor.Focus();
            }
        }