Example #1
0
 private void LoadPHPHelp()
 {
     if (phpHelp == null)
     {
         string phpHelpFile = "help/" + Thread.CurrentThread.CurrentUICulture.Name + "/php_manual.chm";
         if (File.Exists(phpHelpFile))
         {
             phpHelp = new HtmlHelpSystem();
             phpHelp.OpenFile(phpHelpFile);
         }
     }
 }
Example #2
0
        public void AddHelp(string title, string fileName)
        {
            HtmlHelpSystem helpFile = new HtmlHelpSystem();

            helpFile.OpenFile(fileName);
            helpSystems.Add(helpFile);

            /*
             * phpHelpFile =
             * mysqlHelpFile = new HtmlHelpSystem();
             * phpHelpFile.OpenFile();
             * mysqlHelpFile.OpenFile("help/mysql_5.0_en.chm");
             */
            Node node = new Node(title);

            node.Image  = hhImages.Images[3];
            node.Object = helpFile;
            _model.Nodes.Add(node);
        }
Example #3
0
        private void LoadCHM()
        {
            string CHMFilename = Path.Combine(Settings.Default.ChmPath, Settings.Default.MainChm);

            chm = new HtmlHelpSystem();
            chm.OpenFile(CHMFilename, null);

            Console.WriteLine(String.Format("Loaded main CHM: {0}",
                                            Path.GetFileName(CHMFilename)));
            foreach (string filename in Directory.GetFiles(Settings.Default.ChmPath))
            {
                if (!Path.GetExtension(filename).ToLower().Equals(".chm"))
                {
                    continue;
                }
                if (Path.GetFileName(filename).ToLower().Equals(Settings.Default.MainChm))
                {
                    continue;
                }

                Console.WriteLine(String.Format("Loading CHM: {0}",
                                                Path.GetFileName(filename)));
                try
                {
                    chm.MergeFile(filename);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(String.Format("Could not load CHM: {0}. Exception {1}",
                                                    Path.GetFileName(filename),
                                                    ex));
                }
            }
            Console.WriteLine(String.Format("Loaded {0} CHMs",
                                            chm.FileList.Length));
        }
        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
            {
            }
        }
 private void OpenFile(string fileName)
 {
     _reader.OpenFile(fileName, _dmpInfo);
 }
Example #6
0
        public void Open(string pageFile)
        {
            _isHelpLoaded = false;
            // open the chm-file selected in the OpenFileDialog
            string strPath = pageFile;

            string strHelpFile = null;

            if (strPath != null && File.Exists(strPath))
            {
                strHelpFile = strPath;
            }
            else
            {
                return;
            }

            this.Cursor = Cursors.WaitCursor;

            if (webBrowser != null && webBrowser.IsHandleCreated)
            {
                webBrowser.Navigate("http://www.codeplex.com/SandAssist/");
            }

            try
            {
                // clear current items
                helpTocTree.ClearContents();
                helpIndex.ClearContents();
                helpSearch.ClearContents();

                _reader.OpenFile(strHelpFile, _dmpInfo);

                // Enable the toc-tree pane if the opened file has a table of contents
                helpTocTree.Enabled = _reader.HasTableOfContents;
                // Enable the index pane if the opened file has an index
                helpIndex.Enabled = _reader.HasIndex;
                // Enable the full-text search pane if the opened file supports full-text searching
                helpSearch.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;

                tabControl.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 class library control
                helpTocTree.BuildTOC(_reader.HtmlHelpToc, _filter);

                // Build the index entries in the class library control
                if (_reader.HasKLinks)
                {
                    helpIndex.BuildIndex(_reader.Index, IndexType.KeywordLinks, _filter);
                }
                else if (_reader.HasALinks)
                {
                    helpIndex.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);

                _isHelpLoaded = true;
            }
            catch (Exception ex)
            {
                _isHelpLoaded = false;
                this.Cursor   = Cursors.Arrow;

                throw ex;
            }

            this.Cursor = Cursors.Arrow;
        }