Пример #1
0
        private void ListViewDoubleClick(object sender, EventArgs e)
        {
            ListViewItem lvi = listView.SelectedItems[0];

            if (lvi != null && lvi.Tag != null && lvi.Tag is IHxTopic)
            {
                WebBrowserHelper.OpenHelpView((IHxTopic)lvi.Tag);
            }
        }
Пример #2
0
 private void CallHelp(string topic, bool syncToc)
 {
     if (!string.IsNullOrEmpty(topic))
     {
         if (syncToc)
         {
             this.SynchronizeToc(topic);
         }
         WebBrowserHelper.OpenHelpView(topic);
     }
 }
Пример #3
0
        private void ListViewDoubleClick(object sender, EventArgs e)
        {
            bool hiliteMatches = (HtmlHelp2SearchPad.Current != null && HtmlHelp2SearchPad.Current.HiliteEnabled);

            ListViewItem lvi = listView.SelectedItems[0];

            if (lvi != null && lvi.Tag != null && lvi.Tag is IHxTopic)
            {
                WebBrowserHelper.OpenHelpView((IHxTopic)lvi.Tag, hiliteMatches);
            }
        }
Пример #4
0
        private void ShowSelectedItemEntry(string indexTerm, int indexSlot)
        {
            if (HtmlHelp2IndexResultsPad.Current == null)
            {
                ShowIndexResultsMenuCommand cmd = new ShowIndexResultsMenuCommand();
                cmd.Run();
                if (HtmlHelp2IndexResultsPad.Current == null)
                {
                    return;
                }
            }

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

                try
                {
                    HtmlHelp2IndexResultsPad.Current.CleanUp();
                    HtmlHelp2IndexResultsPad.Current.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.Current.IndexResultsListView.Items.Add(lvi);
                    }
                }
                finally
                {
                    HtmlHelp2IndexResultsPad.Current.IndexResultsListView.EndUpdate();
                    HtmlHelp2IndexResultsPad.Current.SortLV(0);
                    HtmlHelp2IndexResultsPad.Current.SetStatusMessage(indexTerm);
                }

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

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

                default:
                    HtmlHelp2IndexResultsPad.Current.BringPadToFront();
                    break;
                }
            }
            catch (System.Runtime.InteropServices.COMException cEx)
            {
                LoggingService.Error("Help 2.0: cannot get matching index entries; " + cEx.ToString());
            }
        }