// GetKeywords() private void GetKeywordsBtn_Click(object sender, EventArgs e) { ClearAll(); if (!Globals.catalog.IsOpen) { MessageBox.Show("Open a catalog first!"); return; } Cursor.Current = Cursors.WaitCursor; try { //Setup screen splitContainer1.Panel1Collapsed = false; resultsPanel.SetupView(Panel_HelpTopicResults.HelpTopicResultsView.AllTopics); _helpKeywords = Globals.catalogRead.GetKeywords(Globals.catalog, true); //true = caching. This really speeds up loading keywordsListView.VirtualListSize = _helpKeywords.Count; UpdateStatus(); } catch { ClearAll(); MessageBox.Show("Exception while calling catalogRead.GetKeywords()"); } finally { Cursor.Current = Cursors.Default; } }
public void ClearAll() //call when Catalog is closed { resultsPanel.Clear(); keywordsListView.VirtualListSize = 0; indexCache.Clear(); _helpKeywords = null; }
//call when Catalog is closed public void ClearAll() { resultsPanel.Clear(); keywordsListView.VirtualListSize = 0; indexCache.Clear(); _helpKeywords = null; }
private void LoadCatalog(String catalogPath, String locale) { String displayName = ""; _CatalogLocale = locale; try { CloseCatalog(); // == Open Catalog from Registered Catalog dropdown list == if (String.IsNullOrEmpty(catalogPath)) { if (_calalogList.Count == 0) { MessageBox.Show("No registered catalogs found. Is help configured?"); return; } else { int i = _SelectedCatalog; _catalog.Open(_calalogList[i].LocationPath, new String[] { _calalogList[i].Locale }); if (!String.IsNullOrEmpty(_calalogList[i].CatalogName)) { displayName = _calalogList[i].CatalogName; } else { displayName = _calalogList[i].LocationPath + " | " + _calalogList[i].Locale; } CheckCatalogMnu(i); } } // == Open a .mshx File else if (File.Exists(catalogPath)) // .mshx file { _catalog.OpenMshx(catalogPath); displayName = catalogPath; } // == Open catalog folder else if (Directory.Exists(catalogPath)) { _catalog.Open(catalogPath, new String[] { locale }); displayName = catalogPath + " | " + locale; } else { return; } //Sucess? if (!_catalog.IsOpen) { MessageBox.Show("Unknown error opening _catalog \n" + _calalogList[0].LocationPath + " | " + _calalogList[0].Locale); } else { MsxhelpProtocol.Catalog = _catalog; this.Text = formTitle + " - " + displayName; //Fill TOC tocPanel.HelpCatalog = _catalog; tocPanel.SelectFirstNode(); // Index Tab _helpKeywords = _catalogRead.GetKeywords(_catalog, true); //true = caching to speed up loading indexListView.VirtualListSize = _helpKeywords.Count; //tell virtual list to fill itself try { if (initialQuery != null) { DoNavigateByF1Keyword(initialQuery); } } catch { } } } catch { MessageBox.Show("Exception acessing catalog. Is catalog valid? \n" + catalogPath + " | " + locale); } }
private void LoadCatalog(String catalogPath, String locale) { String displayName = ""; _CatalogLocale = locale; try { CloseCatalog(); // == Open Catalog from Registered Catalog dropdown list == if (String.IsNullOrEmpty(catalogPath)) { if (_calalogList.Count == 0) { MessageBox.Show("No registered catalogs found. Is help configured?"); return; } else { int i = _SelectedCatalog; _catalog.Open(_calalogList[i].LocationPath, new String[] { _calalogList[i].Locale }); if (!String.IsNullOrEmpty(_calalogList[i].CatalogName)) displayName = _calalogList[i].CatalogName; else displayName = _calalogList[i].LocationPath + " | " + _calalogList[i].Locale; CheckCatalogMnu(i); } } // == Open a .mshx File else if (File.Exists(catalogPath)) // .mshx file { _catalog.OpenMshx(catalogPath); displayName = catalogPath; } // == Open catalog folder else if (Directory.Exists(catalogPath)) { _catalog.Open(catalogPath, new String[] { locale }); displayName = catalogPath + " | " + locale; } else return; //Sucess? if (!_catalog.IsOpen) MessageBox.Show("Unknown error opening _catalog \n" + _calalogList[0].LocationPath + " | " + _calalogList[0].Locale); else { MsxhelpProtocol.Catalog = _catalog; this.Text = formTitle + " - " + displayName; //Fill TOC tocPanel.HelpCatalog = _catalog; tocPanel.SelectFirstNode(); // Index Tab _helpKeywords = _catalogRead.GetKeywords(_catalog, true); //true = caching to speed up loading indexListView.VirtualListSize = _helpKeywords.Count; //tell virtual list to fill itself try { if (initialQuery != null) { DoNavigateByF1Keyword(initialQuery); } } catch { } } } catch { MessageBox.Show("Exception acessing catalog. Is catalog valid? \n" + catalogPath + " | " + locale); } }