Example #1
0
        private void AddMshxFileBtn_Click(object sender, EventArgs e)
        {
            DoCloseCatalog();  //close anything currently open
            EnableDisable();

            // Displays an OpenFileDialog for *.mshx
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.Filter          = "MSHX Help Filess|*.mshx";
            openFileDialog1.Title           = "Select an MSHX file";
            openFileDialog1.CheckFileExists = true;
            openFileDialog1.CheckPathExists = true;
            openFileDialog1.DefaultExt      = ".mshx";
            //openFileDialog1.InitialDirectory
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                String filePath = openFileDialog1.FileName;

                //Add catalog file to list
                int origCount = _catalogList.Count;
                int i         = CatalogList.WildAddCollection(filePath, _catalogList, "");
                if (i >= 0)
                {
                    FillCatalogListBox(i);
                }
            }
        }
Example #2
0
        private void AddCatalogFolderBtn_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog();

            if (_flatCalaogList.Count > 0)
            {
                folderBrowserDialog1.SelectedPath = ((FlatCatalogListItem)_flatCalaogList[0]).LocationPath;
            }
            folderBrowserDialog1.Description = "Add a catalog folder";

            if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
            {
                String folder = folderBrowserDialog1.SelectedPath;

                //Add catalog folder to list
                int origCount = _catalogList.Count;
                int i         = CatalogList.WildAddCollection(folder, _catalogList, "");

                if (i < 0)
                {
                    MessageBox.Show("Directory does not contain a \"ContentStore\" folder.\n" + folder);
                }
                else
                {
                    FillCatalogListBox(i);
                }
            }
        }
Example #3
0
        public Page_Catalogs()
        {
            InitializeComponent();
            self = this;

            //List of available Catalogs
            _catalogList = CatalogList.GetCatalogs();   //Get list from the HV2 registry

            //Add Windows 8 catalogs if found
            String winDir = Environment.GetFolderPath(Environment.SpecialFolder.Windows);

            CatalogList.WildAddCollection(Path.Combine(winDir, "help\\windows\\"), _catalogList, "Windws 8 Help");
            CatalogList.WildAddCollection(Path.Combine(winDir, "help\\oem\\"), _catalogList, "Windws 8 OEM Help");

            FillCatalogListBox(0);
            RegistryDumpToDebug();

            //SuperTips
            new SuperTip(OpenCatalogBtnTip, "ICatalog.Open(catalogDirectory, localeList)",
                         "Open a catalog to view its contents with the various ICatalogRead. methods.",
                         "A valid catalog directory will contain the folders \"ContentStore\" & \"IndexStore\".",
                         "Always close your catalogs when done by calling ICatalog.Close()."
                         );

            new SuperTip(GetCatalogReadWriteLockBtnTip, "ICatalog.GetReadWriteLock(catalogDirectory)",
                         "Returns an ICatalogReadWriteLock object to set/get locking at the catalog level.");

            new SuperTip(AvailableCatalogsTip, "Available Catalogs",
                         "Microsoft HlpViewer.exe can open a catalog by a short ID if the catalog is registered (in registry).",
                         "We can also open a catalog by the directory path. And there are special standalone help files",
                         "(.MSHX) that contain both (.mshc) content and (.mshi) index information.");

            new SuperTip(AddBtnTip, "Add Catalog Folder or File",
                         "You can open an unregistered catalog by using its full directory path.",
                         "You can also open a .mshx file. These files contain both .mshc (content)",
                         " & .mshi (index) information like a .chm or .hlp file.");
        }