Browse Source

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

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1492 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Mathias Simmack 19 years ago
parent
commit
bbbf7cf839
  1. 11
      src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/IndexPad.cs
  2. 10
      src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/TocPad.cs
  3. 20
      src/AddIns/Misc/HtmlHelp2/Project/src/Service/HtmlHelp2Service.cs

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

@ -169,6 +169,8 @@ namespace HtmlHelp2 @@ -169,6 +169,8 @@ namespace HtmlHelp2
{
if (!this.controlIsEnabled) return;
try
{
searchTerm.Text = "";
searchTerm.Items.Clear();
indexControl.IndexData = HtmlHelp2Environment.GetIndex(HtmlHelp2Environment.CurrentFilterQuery);
@ -176,6 +178,15 @@ namespace HtmlHelp2 @@ -176,6 +178,15 @@ namespace HtmlHelp2
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)
{

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

@ -205,11 +205,21 @@ namespace HtmlHelp2 @@ -205,11 +205,21 @@ namespace HtmlHelp2
{
if (!this.controlIsEnabled) return;
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)
{

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

@ -201,36 +201,18 @@ namespace HtmlHelp2.Environment @@ -201,36 +201,18 @@ 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;
}
}
public static IHxIndex GetIndex(string filterQuery)
{
try
{
IHxIndex defaultIndex =
(IHxIndex)session.GetNavigationInterface("!DefaultKeywordIndex",
filterQuery,
ref IndexGuid);
(IHxIndex)session.GetNavigationInterface("!DefaultKeywordIndex", filterQuery, ref IndexGuid);
return defaultIndex;
}
catch
{
LoggingService.Error("Help 2.0: cannot connect to IHxIndex interface (Index)");
return null;
}
}
public static void BuildFilterList(ComboBox filterCombobox)
{

Loading…
Cancel
Save