Пример #1
0
        /// <summary>
        /// Updates the results.
        /// </summary>
        /// <param name="resultSet">The <see cref="ISearchResultSet"/> containing results.</param>
        private void UpdateResults(ISearchResultSet resultSet)
        {
            // Show the results
            resultsToolWindow.Title = String.Format("Find Results - {0} match{1}", resultSet.Results.Count, (resultSet.Results.Count == 1 ? String.Empty : "es"));
            resultsTextBox.Text     = resultSet.ToString();

            // Save the result set
            lastResultSet = resultSet;
        }
Пример #2
0
        /// <summary>
        /// Updates the results.
        /// </summary>
        /// <param name="resultSet">The <see cref="ISearchResultSet"/> containing results.</param>
        private void UpdateResults(ISearchResultSet resultSet)
        {
            // Show the results
            findResultsToolWindow.Title = String.Format("Find Results - {0} match{1}", resultSet.Results.Count, (resultSet.Results.Count == 1 ? String.Empty : "es"));
            findResultsTextBox.Text     = resultSet.ToString();

            switch (resultSet.OperationType)
            {
            case SearchOperationType.FindAll:
            case SearchOperationType.ReplaceAll:
                // Activate the find results tool window
                findResultsToolWindow.Activate(false);
                break;
            }

            // Save the result set
            lastResultSet = resultSet;
        }
Пример #3
0
        /// <summary>
        /// Occurs when a search operation occurs in a view.
        /// </summary>
        /// <param name="window">The window that was searched.</param>
        /// <param name="resultSet">An <see cref="ISearchResultSet"/> that contains the search results.</param>
        public void NotifyEditorViewSearch(EditorDocumentWindow window, ISearchResultSet resultSet)
        {
            // Show the results
            findResultsToolWindow.Title       = String.Format("Find Results - {0} match{1}", resultSet.Results.Count, (resultSet.Results.Count == 1 ? String.Empty : "es"));
            findResultsToolWindow.DataContext = window.Editor;
            findResultsTextBox.Text           = resultSet.ToString();
            findResultsTextBox.DataContext    = resultSet;

            if (findResultsToolWindow.IsOpen)
            {
                findResultsToolWindow.Activate(false);
            }

            if (resultSet.Results.Count > 0)
            {
                window.Activate();
            }
        }