Beispiel #1
0
        private void ShowSelectedItemEntry(string indexTerm, int indexSlot)
        {
            PadDescriptor indexResults =
                WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2IndexResultsPad));

            if (indexResults == null)
            {
                return;
            }

            try
            {
                IHxTopicList matchingTopics = indexControl.IndexData.GetTopicsFromSlot(indexSlot);

                try
                {
                    ((HtmlHelp2IndexResultsPad)indexResults.PadContent).CleanUp();
                    ((HtmlHelp2IndexResultsPad)indexResults.PadContent).IndexResultsListView.BeginUpdate();

                    foreach (IHxTopic topic in matchingTopics)
                    {
                        ListViewItem lvi = new ListViewItem();
                        lvi.Text =
                            topic.get_Title(HxTopicGetTitleType.HxTopicGetRLTitle,
                                            HxTopicGetTitleDefVal.HxTopicGetTitleFileName);
                        lvi.Tag = topic;
                        lvi.SubItems.Add(topic.Location);
                        ((HtmlHelp2IndexResultsPad)indexResults.PadContent).IndexResultsListView.Items.Add(lvi);
                    }
                }
                finally
                {
                    ((HtmlHelp2IndexResultsPad)indexResults.PadContent).IndexResultsListView.EndUpdate();
                    ((HtmlHelp2IndexResultsPad)indexResults.PadContent).SortLV(0);
                    ((HtmlHelp2IndexResultsPad)indexResults.PadContent).SetStatusMessage(indexTerm);
                }

                switch (matchingTopics.Count)
                {
                case 0:
                    break;

                case 1:
                    IHxTopic topic = (IHxTopic)matchingTopics.ItemAt(1);
                    if (topic != null)
                    {
                        ShowHelpBrowser.OpenHelpView(topic);
                    }
                    break;

                default:
                    indexResults.BringPadToFront();
                    break;
                }
            }
            catch (System.Runtime.InteropServices.COMException cEx)
            {
                LoggingService.Error("Help 2.0: cannot get matching index entries; " + cEx.ToString());
            }
        }
//		[PermissionSet(SecurityAction.LinkDemand, Name="Execution")]
        public override void DocumentCompleted(HtmlViewPane pane, WebBrowserDocumentCompletedEventArgs e)
        {
            if (pane == null)
            {
                throw new ArgumentNullException("pane");
            }
            ShowHelpBrowser.HighlightDocument(pane);
        }
Beispiel #3
0
        private void TreeNodeDoubleClick(object sender, EventArgs e)
        {
            TreeNode tn = tv.SelectedNode;

            if (tn != null && tn.Tag != null && tn.Tag is string && (string)tn.Tag != "")
            {
                ShowHelpBrowser.OpenHelpView((string)tn.Tag);
            }
        }
        private void ListViewDoubleClick(object sender, EventArgs e)
        {
            ListViewItem lvi = listView.SelectedItems[0];

            if (lvi != null && lvi.Tag != null && lvi.Tag is IHxTopic)
            {
                ShowHelpBrowser.OpenHelpView((IHxTopic)lvi.Tag);
            }
        }
Beispiel #5
0
 private void CallHelp(string topic, bool syncToc)
 {
     if (!string.IsNullOrEmpty(topic))
     {
         if (syncToc)
         {
             this.SynchronizeToc(topic);
         }
         ShowHelpBrowser.OpenHelpView(topic);
     }
 }
Beispiel #6
0
        private void ListViewDoubleClick(object sender, EventArgs e)
        {
            PadDescriptor search        = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2SearchPad));
            bool          hiliteMatches = (search != null && ((HtmlHelp2SearchPad)search.PadContent).HiliteEnabled);

            ListViewItem lvi = listView.SelectedItems[0];

            if (lvi != null && lvi.Tag != null && lvi.Tag is IHxTopic)
            {
                ShowHelpBrowser.OpenHelpView((IHxTopic)lvi.Tag, hiliteMatches);
            }
        }
        private void OnLinkClick(object sender, HtmlElementEventArgs e)
        {
            HtmlElement link = sender as HtmlElement;

            if (link != null)
            {
                string url = link.GetAttribute("src");
                if (!string.IsNullOrEmpty(url))
                {
                    ShowHelpBrowser.OpenHelpView(url);
                }
            }
        }