/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChmTocTab)); this.tocTree = new Netron.Neon.HtmlHelp.UIComponents.TocTree(); this.SuspendLayout(); // // tocTree // this.tocTree.Dock = System.Windows.Forms.DockStyle.Fill; this.tocTree.Location = new System.Drawing.Point(0, 0); this.tocTree.Name = "tocTree"; this.tocTree.Padding = new System.Windows.Forms.Padding(2); this.tocTree.Size = new System.Drawing.Size(292, 273); this.tocTree.TabIndex = 0; this.tocTree.TocSelected += new Netron.Neon.HtmlHelp.UIComponents.TocSelectedEventHandler(this.tocTree_TocSelected); // // ChmTocTab // this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.ClientSize = new System.Drawing.Size(292, 273); this.Controls.Add(this.tocTree); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "ChmTocTab"; this.Text = "ChmTocTab"; this.ResumeLayout(false); }
public void LoadCHM(string filePath) { ChmInit(); try { //make sure the TOC is ready if (TocTree == null) { OpenChmTocTab(); } // clear current items TocTree.ClearContents(); // helpIndex1.ClearContents(); // helpSearch2.ClearContents(); // open the chm-file selected in the OpenFileDialog _reader.OpenFile(filePath, _dmpInfo); _reader.MergeFile("test.chm"); // Enable the toc-tree pane if the opened file has a table of contents TocTree.Enabled = _reader.HasTableOfContents; // Enable the index pane if the opened file has an index // helpIndex1.Enabled = _reader.HasIndex; // Enable the full-text search pane if the opened file supports full-text searching // helpSearch2.Enabled = _reader.FullTextSearch; // btnContents.Enabled = _reader.HasTableOfContents; // btnIndex.Enabled = _reader.HasIndex; // btnSearch.Enabled = _reader.FullTextSearch; // // miContents.Enabled = _reader.HasTableOfContents; // miContents1.Enabled = _reader.HasTableOfContents; // miIndex.Enabled = _reader.HasIndex; // miIndex1.Enabled = _reader.HasIndex; // miSearch.Enabled = _reader.FullTextSearch; // miSearch1.Enabled = _reader.FullTextSearch; // btnSynch.Enabled = _reader.HasTableOfContents; // // tabControl1.SelectedIndex = 0; // // btnRefresh.Enabled = true; // if( _reader.DefaultTopic.Length > 0) // { // btnHome.Enabled = true; // miHome.Enabled = true; // } // Build the table of contents tree view in the classlibrary control TocTree.BuildTOC(_reader.TableOfContents, _filter); // Build the index entries in the classlibrary control // if( _reader.HasKLinks ) // helpIndex1.BuildIndex( _reader.Index, IndexType.KeywordLinks, _filter ); // else if( _reader.HasALinks ) // helpIndex1.BuildIndex( _reader.Index, IndexType.AssiciativeLinks, _filter ); // Navigate the embedded browser to the default help topic // NavigateBrowser( _reader.DefaultTopic ); // miMerge.Enabled = true; // miCloseFile.Enabled = true; // // this.Text = _reader.FileList[0].FileInfo.HelpWindowTitle + " - HtmlHelp - Viewer"; // // miCustomize.Enabled = ( _reader.HasInformationTypes || _reader.HasCategories); // Force garbage collection to free memory GC.Collect(); } finally { } }