phdesign.NppToolBucket.FindAndReplace.ShowForm C# (CSharp) Method

ShowForm() private method

private ShowForm ( ) : void
return void
        private void ShowForm()
        {
            if (_window.Visible) return;

            // Reset the search in
            if (_window.SearchIn == SearchInOptions.SelectedText)
                _window.SearchIn = SearchInOptions.CurrentDocument;

            // If selection is small, use it as find text, otherwise search in selection.
            var selLength = _editor.GetSelectionLength();
            if (selLength > 1)
            {
                var selectedText = _editor.GetSelectedText();
                if (selLength < UseSelectionAsFindTextLength && !selectedText.Contains("\n"))
                    _window.FindText = selectedText;
                else
                    _window.SearchIn = SearchInOptions.SelectedText;
            }

            _window.Show(_owner);
        }

Usage Example

Esempio n. 1
0
 internal static void Show()
 {
     if (_instance == null)
     {
         _instance = new FindAndReplace();
     }
     _instance.ShowForm();
 }