Browse Source

catched an exception with invalid pointers (http://community.sharpdevelop.net/forums/thread/8728.aspx)

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1491 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Mathias Simmack 19 years ago
parent
commit
d9c8886140
  1. 25
      src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/IndexPad.cs
  2. 18
      src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/TocPad.cs
  3. 30
      src/AddIns/Misc/HtmlHelp2/Project/src/Service/HtmlHelp2Service.cs

25
src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/IndexPad.cs

@ -168,13 +168,24 @@ namespace HtmlHelp2 @@ -168,13 +168,24 @@ namespace HtmlHelp2
public void LoadIndex()
{
if (!this.controlIsEnabled) return;
searchTerm.Text = "";
searchTerm.Items.Clear();
indexControl.IndexData = HtmlHelp2Environment.GetIndex(HtmlHelp2Environment.CurrentFilterQuery);
filterCombobox.SelectedIndexChanged -= new EventHandler(FilterChanged);
HtmlHelp2Environment.BuildFilterList(filterCombobox);
filterCombobox.SelectedIndexChanged += new EventHandler(FilterChanged);
try
{
searchTerm.Text = "";
searchTerm.Items.Clear();
indexControl.IndexData = HtmlHelp2Environment.GetIndex(HtmlHelp2Environment.CurrentFilterQuery);
filterCombobox.SelectedIndexChanged -= new EventHandler(FilterChanged);
HtmlHelp2Environment.BuildFilterList(filterCombobox);
filterCombobox.SelectedIndexChanged += new EventHandler(FilterChanged);
}
catch
{
LoggingService.Error("Help 2.0: cannot connect to IHxIndex interface (Index)");
indexControl.Enabled = false;
indexControl.BackColor = SystemColors.ButtonFace;
filterCombobox.Enabled = false;
searchTerm.Enabled = false;
}
}
private void FilterChanged(object sender, EventArgs e)

18
src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/TocPad.cs

@ -205,10 +205,20 @@ namespace HtmlHelp2 @@ -205,10 +205,20 @@ namespace HtmlHelp2
{
if (!this.controlIsEnabled) return;
tocControl.Hierarchy = HtmlHelp2Environment.GetTocHierarchy(HtmlHelp2Environment.CurrentFilterQuery);
filterCombobox.SelectedIndexChanged -= new EventHandler(this.FilterChanged);
HtmlHelp2Environment.BuildFilterList(filterCombobox);
filterCombobox.SelectedIndexChanged += new EventHandler(this.FilterChanged);
try
{
tocControl.Hierarchy = HtmlHelp2Environment.GetTocHierarchy(HtmlHelp2Environment.CurrentFilterQuery);
filterCombobox.SelectedIndexChanged -= new EventHandler(this.FilterChanged);
HtmlHelp2Environment.BuildFilterList(filterCombobox);
filterCombobox.SelectedIndexChanged += new EventHandler(this.FilterChanged);
}
catch
{
LoggingService.Error("Help 2.0: cannot connect to IHxHierarchy interface (Contents)");
tocControl.Enabled = false;
tocControl.BackColor = SystemColors.ButtonFace;
filterCombobox.Enabled = false;
}
}
private void FilterChanged(object sender, EventArgs e)

30
src/AddIns/Misc/HtmlHelp2/Project/src/Service/HtmlHelp2Service.cs

@ -203,34 +203,16 @@ namespace HtmlHelp2.Environment @@ -203,34 +203,16 @@ namespace HtmlHelp2.Environment
public static IHxHierarchy GetTocHierarchy(string filterQuery)
{
try
{
IHxHierarchy defaultToc =
(IHxHierarchy)session.GetNavigationInterface("!DefaultTOC", filterQuery, ref TocGuid);
return defaultToc;
}
catch
{
LoggingService.Error("Help 2.0: cannot connect to IHxHierarchy interface (Contents)");
return null;
}
IHxHierarchy defaultToc =
(IHxHierarchy)session.GetNavigationInterface("!DefaultTOC", filterQuery, ref TocGuid);
return defaultToc;
}
public static IHxIndex GetIndex(string filterQuery)
{
try
{
IHxIndex defaultIndex =
(IHxIndex)session.GetNavigationInterface("!DefaultKeywordIndex",
filterQuery,
ref IndexGuid);
return defaultIndex;
}
catch
{
LoggingService.Error("Help 2.0: cannot connect to IHxIndex interface (Index)");
return null;
}
IHxIndex defaultIndex =
(IHxIndex)session.GetNavigationInterface("!DefaultKeywordIndex", filterQuery, ref IndexGuid);
return defaultIndex;
}
public static void BuildFilterList(ComboBox filterCombobox)

Loading…
Cancel
Save