public int _totalAvailableHits = 0; //total hits in all _pages -- Do a search call to fill each page private void DoSearch() { if (!Globals.catalog.IsOpen) { MessageBox.Show("Open a catalog first!"); return; } HelpFilter filter = null; //no fancy adv filtering yet UpdateStatus(false); Cursor.Current = Cursors.WaitCursor; resultsPanel.Clear(); try { ITopicCollection helpTopics = Globals.catalogRead.GetSearchResults(Globals.catalog, _sQuery, filter, _searchOptions, _pageSize, _pageNumber, out _totalAvailableHits); resultsPanel.SetVirtualList(helpTopics); UpdateStatus(true); } catch { resultsPanel.Clear(); _pageNumber = 1; _totalAvailableHits = 0; MessageBox.Show("Exception calling ICatalogRead.GetSearchResults(..)"); return; } finally { Cursor.Current = Cursors.Default; } }
// TOC Command private void DoTOCCmd() { if (!Globals.catalog.IsOpen) { MessageBox.Show("Open a catalog first!"); return; } String TopicId = TopicIdCbo.Text.Trim(); if (String.IsNullOrEmpty(TopicId)) { MessageBox.Show("Topic ID required. "); return; } HelpFilter filter = null; //no fancy adv filtering yet resultsPanel.Clear(); TocReturnDetail tocDetail = (TocReturnDetail)tocDetailsCbo.SelectedIndex; Cursor.Current = Cursors.WaitCursor; try { ITopicCollection helpTopics = Globals.catalogRead.GetTableOfContents(Globals.catalog, TopicId, filter, tocDetail); resultsPanel.SetVirtualList(helpTopics); } catch { resultsPanel.Clear(); MessageBox.Show("Exception calling ICatalogRead.GetTableOfContents(..)"); } finally { Cursor.Current = Cursors.Default; } }
private void keywordsListView_SelectedIndexChanged(object sender, EventArgs e) { int index = SelectedKeyword; if (index < 0 || index >= _helpKeywords.Count) { return; } _helpKeywords.MoveTo(index); IKeyword keyword = (IKeyword)_helpKeywords.Current; keywordsTextBox.Clear(); RichTextBoxFuncs rtf = new RichTextBoxFuncs(keywordsTextBox); rtf.WriteLine("IKeyword Members:"); rtf.WriteLine("DisplayValue", keyword.DisplayValue); rtf.WriteLine("IsSubkey", keyword.IsSubkey.ToString()); rtf.WriteLine("Value", keyword.Value); rtf.WriteLine("Topics", keyword.Topics.Count.ToString()); //Fill Results Panel resultsPanel.SetVirtualList(keyword.Topics); }