Example #1
0
        private void RegistryDumpToDebug()  // HV2 registry info --> Debug window
        {
            DebugForm.Clear();
            HV2RegInfo regInfo = new HV2RegInfo();

            Color textColor = Color.DarkCyan;

            DebugForm.rtf.WriteLine("RegistryView: " + regInfo.RegistryView.ToString(), textColor);
            DebugForm.rtf.WriteLine(@"[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Help\v2.0]");
            DebugForm.rtf.WriteLine("AppRoot: " + regInfo.AppRoot, textColor);
            DebugForm.rtf.WriteLine("DefaultHelpViewerCLSID = " + regInfo.DefaultHelpViewerCLSID, textColor);
            DebugForm.rtf.WriteLine(@"[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Help\v2.0\Catalogs]");
            DebugForm.rtf.WriteLine("ContentStore = " + regInfo.ContentStore, textColor);
            DebugForm.rtf.WriteLine("");

            List <CatalogItem> catalogList = CatalogList.GetCatalogs();

            catalogList.ForEach(delegate(CatalogItem catalog)
            {
                DebugForm.rtf.WriteLine(@"[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Help\v2.0\Catalogs\" + catalog.CatalogID + "]");
                DebugForm.rtf.WriteLine("   LocationPath = " + catalog.LocationPath, textColor);
                catalog.Locales.ForEach(delegate(CatalogLocaleItem catlocale)
                {
                    DebugForm.rtf.WriteLine(@"   [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Help\v2.0\Catalogs\" + catalog.CatalogID + "\\" + catlocale.Locale + "]");
                    DebugForm.rtf.WriteLine("   CatalogName = " + catlocale.CatalogName, textColor);
                    DebugForm.rtf.WriteLine("   SeedFilePath = " + catlocale.SeedFilePath, textColor);
                });
            });
        }
Example #2
0
        public Page_Store()
        {
            InitializeComponent();
            self = this;


            // Init Catalog Cbo with catalog paths from the registry
            List <CatalogItem> _catalogList = CatalogList.GetCatalogs();   //Get list from the HV2 registry

            catalogPathCbo.Items.Clear();
            foreach (CatalogItem catalog in _catalogList)
            {
                catalogPathCbo.Items.Add(catalog.LocationPath);
            }
            if (catalogPathCbo.Items.Count > 0)  //Select something
            {
                catalogPathCbo.SelectedIndex = 0;
            }

            //Monitoring Catalog Locks
            monitorTimer.Interval = 1000;  //Poll for locks ever 1 sec
            monitorTimer.Tick    += new EventHandler(monitorTimer_Tick);

            //Init SuperTip and tips
            defaultMonitorTip = "Here we display the catalog write lock status on a timer.\nTry performing a catalog update (Help Manager) and watch the status change.\nUseful to apps like this which access catalog files directly.";
            monitorLocksTip   = new SuperTip(CatalogLocksTip, "Monitor Catalog Locks", defaultMonitorTip);
            new SuperTip(LoadButtonTip, "Load",
                         "Given a valid 'managed' catalog location, the Load button code rips",
                         "the various catalog XML files for all catalog configuration data.",
                         "* CatalogType.xml - Required to enable User Managed content.",
                         @"* ContentStore\installedBooks.xml - Lists all catalog books and packages.",
                         @"* ContentStore\<locale>\<packageName>.metadata - Package download related info.");
            new SuperTip(warningTip, "Bypassing the API Warning",
                         "Here we are sneaking around the Help Runtime API and accessing",
                         "help catalog files directly. While this is all very interesting",
                         "as we learn how Help Viewer 2.0 works, the Help API normally",
                         "serves most of our needs, and we don't want to block or upset",
                         "the normal operation of the help system.");
            CopyBtn.ToolTipText     = "Copy node & sub-node text\n(Ctrl+C)";
            ExplorerBtn.ToolTipText = "Show the associated XML file in Explorer\n(Ctrl+E)";

            EnableDisable();
        }
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.");
        }