public void ShowSearchResults(ISearchResult result) { if (result == null) throw new ArgumentNullException("result"); // move result to top of last searches lastSearches.Remove(result); lastSearches.Insert(0, result); // limit list of last searches to 15 entries while (lastSearches.Count > 15) lastSearches.RemoveAt(15); contentPlaceholder.SetContent(result.GetControl()); toolBar.Items.Clear(); foreach (object toolBarItem in defaultToolbarItems) { toolBar.Items.Add(toolBarItem); } IList additionalToolbarItems = result.GetToolbarItems(); if (additionalToolbarItems != null) { toolBar.Items.Add(new Separator()); foreach (object toolBarItem in additionalToolbarItems) { toolBar.Items.Add(toolBarItem); } } SearchResultsShown.RaiseEvent(this, EventArgs.Empty); }
/// <summary> /// Shows a search in the search results pad. /// The previously shown search will be stored in the list of past searches. /// </summary> public void ShowSearchResults(ISearchResult result) { if (result == null) { throw new ArgumentNullException("result"); } // move result to top of last searches lastSearches.Remove(result); lastSearches.Insert(0, result); // limit list of last searches to 15 entries while (lastSearches.Count > 15) { lastSearches.RemoveAt(15); } if (activeSearchResult != result) { if (activeSearchResult != null) { activeSearchResult.OnDeactivate(); } activeSearchResult = result; } SD.WinForms.SetContent(contentPlaceholder, result.GetControl()); toolBar.Items.Clear(); foreach (object toolBarItem in defaultToolbarItems) { toolBar.Items.Add(toolBarItem); } IList additionalToolbarItems = result.GetToolbarItems(); if (additionalToolbarItems != null) { toolBar.Items.Add(new Separator()); foreach (object toolBarItem in additionalToolbarItems) { toolBar.Items.Add(toolBarItem); } } SearchResultsShown(this, EventArgs.Empty); }