Exemple #1
0
        public Panel_HelpIndexer()
        {
            InitializeComponent();
            self = this;

            Assembly thisAssembly = System.Reflection.Assembly.GetExecutingAssembly();
            _helpIndexerPath = Path.Combine(Path.GetDirectoryName(thisAssembly.Location), "HelpIndexer\\helpIndexer.exe");

            new SuperTip(RunBtnTip, "HelpIndexer.exe",
                "HelpIndexer.exe currently ships with Windows 8 ADK (Assessment and Deployment Kit),",
                "You can download Win 8 ADK from MSDN Subscription Downloads. This page expects",
                "HelpIndexer.exe to be in the following location: ",
                _helpIndexerPath);

            //Persistence: Load settings
            using (UserData userData = new UserData(Globals.DataRegKey))
            {
                InputFilename = userData.ReadStr("Mshx.InputFilename", "");
                OutputDir = userData.ReadStr("Mshx.OutputDir", "");
                OutputName = userData.ReadStr("Mshx.OutputName", "");
                VendorName = userData.ReadStr("Mshx.VendorName", "");
                CombineMode = userData.ReadBool("Mshx.CombineMode", true);
            }
            EnableDisable();
            UpdateCommandLine();
        }
Exemple #2
0
        // Constructor

        public Page_Search()
        {
            InitializeComponent();
            self = this;

            //Panel for to show HelpTopic results
            resultsPanel = new Panel_HelpTopicResults(this, DockStyle.Fill);

            //Search Operator panel
            operatorsPanel = new Panel_SearchOperator(this, SearchCbo);

            //Persistence: Load settings
            using (UserData userData = new UserData(Globals.DataRegKey))
            { 
                SearchCbo.Text = userData.ReadStr("Search.Query", "");
                pageSizeEdit.Value = userData.ReadInt("Search.PageSize", 50);  
            }

            statusLabel.Text = "--";
            UpdateStatus(false);

            //Super Tips
            new SuperTip(tipResultsPerPage, "Results pre Page", 
                "Often many 1000's of search results will be available.",
                "So search calls return just one page of results at a time.",
                "In this demo you can specify the size of a page and use",
                "next and previous links to step through all available pages.");
            new SuperTip(tipMatchHighlighting, "Match Highlighting",
                "When checked search results are wrapped in <span> tags",
                "to highlight search query terms. This would be useful if",
                "you were creating your own HTML page of search results.");
            new SuperTip(tipOrQueryTerms, "OR Query Terms",
                "Normally when you enter 2 or more search query terms, they",
                "are AND'd together. Check this box to 'OR' them instead.");
        }
Exemple #3
0
        // Constructor
        public Page_TOC()
        {
            InitializeComponent();
            self = this;

            //Panel for to show HelpTopic results
            resultsPanel = new Panel_HelpTopicResults(this, DockStyle.Fill);

            //Toc Select panel
            tocPanel = new Panel_Toc(this, TopicIdCbo, Globals.catalog);

            //Persistence: Load settings
            using (UserData userData = new UserData(Globals.DataRegKey))
            {
                TopicIdCbo.Text = userData.ReadStr("Toc.TopicIdCbo", "");
            }

            //Fill TocReturnDetail Enumeration dropdown
            tocDetailsCbo.Items.Clear();
            foreach (TocReturnDetail value in Enum.GetValues(typeof(TocReturnDetail)))
                tocDetailsCbo.Items.Add(value.ToString());
            tocDetailsCbo.SelectedIndex = 0;

            //SuperTips
            new SuperTip(TopicIDPictureBox, "Topic ID",
                "Enter topic ID or select one from the drop down.",
                "Select the TocReturnDetail you want and click the Get button.",
                "Use an Id=\"-1\" to specify the virtual root page of the catalog");

            new SuperTip(tocDetailsCboTip,  ToolTipIcon.Warning, "Warning", "Using 'TocReturnDetail.TocDescendants' can take a long time to complete",
                      "since a top level node can return many 1000's of child/sub-child items.",
                      "In this case be patient. The call will return eventually.");

            new SuperTip(HlpViewerBtn, "Show in HlpViewer", "Show selected help topic in HlpViewer.exe");
        }
Exemple #4
0
 private void Form_RunHelpIndexer_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (!e.Cancel)
     {
         //Save form size/pos
         using (UserData userData = new UserData(Globals.DataRegKey))
            { userData.SaveFormPos(this); }
     }
 }
Exemple #5
0
        public Page_Topics()
        {
            InitializeComponent();
            self = this;

            //Panel for to show HelpTopic results
            resultsPanel = new Panel_HelpTopicResults(this, DockStyle.Fill);
            resultsPanel.SetupView(Panel_HelpTopicResults.HelpTopicResultsView.HelpTopic);

            //Toc Select panel
            tocPanel = new Panel_Toc(this, TopicFromIdCbo, Globals.catalog);

            //Persistence: Load settings
            using (UserData userData = new UserData(Globals.DataRegKey))
            {
                TopicFromIdCbo.Text = userData.ReadStr("Keyword.TopicFromIdCbo", "");
                TopicFromF1TextBox.Text = userData.ReadStr("Keyword.TopicFromF1TextBox", "");
            }

            // Super Tips
            new SuperTip(tipFileStreamOnly, "File Stream Only",
                "The raw unrendered topic source from the .mshc help file.",
                "Expect Script errors. Being unrendered it won't be WebBrowser friendly.");

            new SuperTip(TopicFromIdTip, "Get Topic for Topic ID",
                "ITopic = ICatalogRead.GetIndexedTopicDetails()",
                "IStream = ICatalogRead.GetIndexedTopic()",
                "Enter a topic ID for the required topic.",
                "If successful the call returns a topic file ITopic object or topic IStream.",
                "Note that the topic object also contains a convenient method to Fetch the stream.");
            new SuperTip(TopicFromF1Tip, "Get Topic for F1 Keyword(s)",
                "ITopic = ICatalogRead.GetTopicDetailsForF1Keyword()",
                "IStream = ICatalogRead.GetTopicForF1Keyword()",
                "Enter a prioritized list of F1 keywords separated by '|' chars (arbitary).",
                "If successful the call returns a ITopic Object or a topic IStream.",
                "Note that the topic object also contains a convenient method to Fetch the stream.");
            new SuperTip(GetAssetTip, "IStream catalogRead.GetLinkedAsset(catalog, packageName, path, locale)",
                "Example:    ",
                "   Stream stream = catalogRead.GetLinkedAsset(catalog, ",
                "        \"Visual_Studio_21800791_VS_100_en-us_6.mshc\",",
                "        \"\\R583.htm\", \"en-US\");",
                "For the purpose of this quick demo we get an asset path from ",
                "a Topic obj retieved using the specified topic ID.",
                "However this can be used to retrieve any asset file (image, JS, CSS etc).");
        }
Exemple #6
0
        public Page_EventLog(TabPage hostTabPage)
        {
            InitializeComponent();
            self = this;

            _hostTabPage = hostTabPage;
            if (_hostTabPage != null)
                _hostTabPageText = _hostTabPage.Text;

            //Persistence: Load settings
            using (UserData userData = new UserData(Globals.DataRegKey))
            {
                rdoAll.Checked = userData.ReadBool("EventLog.ShowAll", rdoAll.Checked);
                rdoHelp.Checked = !rdoAll.Checked;
                cbxIncludeHV1.Checked = userData.ReadBool("EventLog.cbxIncludeHV1", cbxIncludeHV1.Checked);
                EnableDisable();
            }

            //Init the log Obj after Loading settings incase setting checkboxes fires refilling
            eventlog = new EventLog("Application");

            //Check for new updates on a timer
            watchTimer = new Timer();
            watchTimer.Interval = 1000;  //msec
            watchTimer.Tick += new EventHandler(Timer_Tick);
            watchTimer.Start();

            new SuperTip(EventLogTip, "Application Event Log",
                "This page just echos the Windows Application Event Log.",
                "Latest entries are at the top. The page tab displays the",
                "number of entries that have arrived since startup.",
                "Blue or purple text = Help Viewer 1.x or 2.x events.");
            new SuperTip(ShowLogTip, "Show",
                "Show All Events - Shows entire Application Event Log",
                "Show HV2 Events - Scans the last 1000 events for HV2 events",
                "  (with the option to include Help Viewer 1.x events).");
        }
Exemple #7
0
        //Radio or Check change
        private void ResetList()
        {
            if (eventlog != null)  //initialized
            {
                if (_hostTabPage != null && _hostTabPage.Text != _hostTabPageText)   //clear xxx (x)
                    _hostTabPage.Text = _hostTabPageText;
                _newItemsSinceStartup = 0;
                _startupCount = -1;
                FillLog();
                _startupCount = listView1.VirtualListSize;

                //Persistence: Save settings
                using (UserData userData = new UserData(Globals.DataRegKey))
                {
                    userData.WriteBool("EventLog.ShowAll", rdoAll.Checked);
                    userData.WriteBool("EventLog.cbxIncludeHV1", cbxIncludeHV1.Checked);
                }
                EnableDisable();
            }
        }
Exemple #8
0
 //called at shutdown
 public void Cleanup()
 {
     //Persistence: Save settings
     using (UserData userData = new UserData(Globals.DataRegKey))
     {
         userData.WriteStr("Mshx.InputFilename", InputFilename);
         userData.WriteStr("Mshx.OutputDir", OutputDir);
         userData.WriteStr("Mshx.OutputName", OutputName);
         userData.WriteStr("Mshx.VendorName", VendorName);
         userData.WriteBool("Mshx.CombineMode", CombineMode);
     }
 }
Exemple #9
0
        private void SearchBtnSearch()
        {
            _sQuery = SearchCbo.Text.Trim();
            if (String.IsNullOrEmpty(_sQuery))
                return;

            _searchOptions = SearchOptions.None;
            if (SearchTermHighlightCbx.Checked)
                _searchOptions = _searchOptions | SearchOptions.SearchTermHighlight;
            if (OrSearchOverrideCbx.Checked)
                _searchOptions = _searchOptions | SearchOptions.OrSearchOverride;

            //When searching with the Search Button we always start from Page 1
            _pageSize = (Int32)pageSizeEdit.Value;
            _pageNumber = 1;
            _totalAvailableHits = 0;
            resultsPanel.startListViewNumbering = 1;

            DoSearch();

            //Persistence: Save settings
            using (UserData userData = new UserData(Globals.DataRegKey))
            {
                userData.WriteStr("Search.Query", SearchCbo.Text);
                userData.WriteInt("Search.PageSize", (int)pageSizeEdit.Value);
            }
        }
Exemple #10
0
 private void TopicIdCbo_TextChanged(object sender, EventArgs e)
 {
     //Persistence: Save settings
     using (UserData userData = new UserData(Globals.DataRegKey))
     {
         userData.WriteStr("Toc.TopicIdCbo", TopicIdCbo.Text);
     }
 }
Exemple #11
0
 private void H2MainForm_Shown(object sender, EventArgs e)
 {
     //Restore form size/pos
     using (UserData userData = new UserData(Globals.DataRegKey))
         { userData.RestoreFormPos(this); }
 }
Exemple #12
0
        private void H2MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (!e.Cancel)
            {
                //Save form size/pos
                using (UserData userData = new UserData(Globals.DataRegKey))
                    { userData.SaveFormPos(this); }

                //Allow Debug form to save pos/size & close
                DebugForm.OkToClose = true;
                DebugForm.self.Close();

                eventLogPage.Cleanup();  //Close eventLog
                Page_CreateMSHX.self.helpIndexer.Cleanup();
            }
        }
Exemple #13
0
        private void Form1_Load(object sender, EventArgs e)
        {
            sourceSplitter.Panel2Collapsed = true;
            //Supertips
            new SuperTip(imageUnrendered, "Unrendered Source (F6)", "Displays the original topic source from the .mshc help file.", "To see the 'rendered' source right-click and 'View Source' the WebBrowser control.");

            //Load the first registered catalog we find
            LoadCatalog();

            //load persistence UI data
            using (UserData userData = new UserData(UIDataStoreKey))
            {
                userData.RestoreFormPos(this);
                splitContainer1.SplitterDistance = userData.ReadInt("NavSplitterPos", splitContainer1.SplitterDistance);
                sourceSplitter.SplitterDistance = userData.ReadInt("SourceSplitterPos", sourceSplitter.SplitterDistance);
                ShowUnrenderedSource(userData.ReadBool("ShowUnrendered", !sourceSplitter.Panel2Collapsed));
            //                SetVSRenderMode(userData.ReadBool("VsRenderer", mnuVSRenderer.Checked));
                autoSyncOption.Checked = userData.ReadBool("AutoSync", autoSyncOption.Checked);
            }

            EnableDisable();
        }
Exemple #14
0
        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            if (_catalog.IsOpen)
                _catalog.Close();

            //save persistence UI data
            using (UserData userData = new UserData(UIDataStoreKey))
            {
                userData.SaveFormPos(this);
                userData.WriteInt("NavSplitterPos", splitContainer1.SplitterDistance);
                userData.WriteInt("SourceSplitterPos", sourceSplitter.SplitterDistance);
                userData.WriteBool("ShowUnrendered", !sourceSplitter.Panel2Collapsed);
            //                userData.WriteBool("VsRenderer", mnuVSRenderer.Checked);
                userData.WriteBool("AutoSync", autoSyncOption.Checked);
            }
        }
Exemple #15
0
        //false to return just the file IStream
        // Get Topic by ID
        private void DoGetTopicFromId(Boolean getDetails)
        {
            if (!Globals.catalog.IsOpen)
            {
                MessageBox.Show("Open a catalog first!");
                return;
            }

            ClearAll();

            IHelpFilter filter = null;  // no filtering

            String topicID = TopicFromIdCbo.Text.Trim();
            if (String.IsNullOrEmpty(topicID))
                return;

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (getDetails)  //Returns detail object
                {
                    resultsPanel.SetupView(Panel_HelpTopicResults.HelpTopicResultsView.HelpTopic);

                    ITopic helpTopic = Globals.catalogRead.GetIndexedTopicDetails(Globals.catalog, topicID, filter);

                    if (helpTopic == null)
                        MessageBox.Show("No results found! Returned null.");
                    else  //display result
                        resultsPanel.DisplayHelpTopic(helpTopic);
                }
                else //Returns just the stream
                {
                    resultsPanel.SetupView(Panel_HelpTopicResults.HelpTopicResultsView.RawContent);

                    //Get Stream only
                    Stream stream = (Stream)Globals.catalogRead.GetIndexedTopic(Globals.catalog, topicID, filter);
                    if (stream == null)
                        MessageBox.Show("No results found! Returned null.");
                    else
                    {
                        resultsPanel.ViewStream(stream);
                        stream.Close();
                    }
                }
            }
            catch
            {
                MessageBox.Show("No results. Exception while calling catalogRead.GetIndexedTopic...()");
            }
            finally
            {
                Cursor.Current = Cursors.Default;

                //Persistence: Save settings
                using (UserData userData = new UserData(Globals.DataRegKey))
                {
                    userData.WriteStr("Keyword.TopicFromIdCbo", TopicFromIdCbo.Text);
                }
            }
        }
Exemple #16
0
        //false to return just the file IStream
        // Get Topic by F1 Keyword
        private void DoGetTopicFromF1(Boolean getDetails)
        {
            if (!Globals.catalog.IsOpen)
            {
                MessageBox.Show("Open a catalog first!");
                return;
            }

            ClearAll();

            IHelpFilter filter = null;  // no filtering

            String keyword = TopicFromF1TextBox.Text.Trim();
            if (String.IsNullOrEmpty(keyword))
                return;

            String[] prioritizedF1Keywords = keyword.Split(new Char[] { '|' });   //arbitarily separate by ;
            for (int i = 0; i < prioritizedF1Keywords.Length; i++)
                prioritizedF1Keywords[i] = prioritizedF1Keywords[i].Trim();

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (getDetails)  //Returns detail and stream
                {
                    resultsPanel.SetupView(Panel_HelpTopicResults.HelpTopicResultsView.HelpTopic);

                    //Do It
                    ITopic helpTopic = Globals.catalogRead.GetTopicDetailsForF1Keyword(Globals.catalog, prioritizedF1Keywords, filter);

                    if (helpTopic == null)
                        MessageBox.Show("No results found! Returned null.");
                    else  //display result
                        resultsPanel.DisplayHelpTopic(helpTopic);
                }
                else              //Returns just the stream
                {
                    resultsPanel.SetupView(Panel_HelpTopicResults.HelpTopicResultsView.RawContent);

                    //Do It
                    Stream stream = (Stream)Globals.catalogRead.GetTopicForF1Keyword(Globals.catalog, prioritizedF1Keywords, filter);

                    if (stream == null)
                        MessageBox.Show("No results found! Returned null.");
                    {
                        resultsPanel.ViewStream(stream);
                        stream.Close();
                    }
                }
            }
            catch
            {
                MessageBox.Show("No results. Exception while calling catalogRead.GetTopic...ForF1Keyword()");
            }
            finally
            {
                Cursor.Current = Cursors.Default;

                //Persistence: Save settings
                using (UserData userData = new UserData(Globals.DataRegKey))
                {
                    userData.WriteStr("Keyword.TopicFromF1TextBox", TopicFromF1TextBox.Text);
                }
            }
        }