Browse Source

Added HtmlHelp2 addin.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@315 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
2acc1100d1
  1. 12
      data/resources/image/BitmapResources/BitmapResources.res
  2. BIN
      data/resources/image/BitmapResources/PadIcons/HtmlHelp2.16x16.DynamicHelp.png
  3. BIN
      data/resources/image/BitmapResources/PadIcons/HtmlHelp2.16x16.Favorites.png
  4. BIN
      data/resources/image/BitmapResources/PadIcons/HtmlHelp2.16x16.Index.png
  5. BIN
      data/resources/image/BitmapResources/PadIcons/HtmlHelp2.16x16.IndexResults.png
  6. BIN
      data/resources/image/BitmapResources/PadIcons/HtmlHelp2.16x16.Search.png
  7. BIN
      data/resources/image/BitmapResources/PadIcons/HtmlHelp2.16x16.SearchResults.png
  8. BIN
      data/resources/image/BitmapResources/PadIcons/HtmlHelp2.16x16.Toc.png
  9. 6
      src/AddIns/Misc/HtmlHelp2/HtmlHelp2.sln
  10. 32
      src/AddIns/Misc/HtmlHelp2/Project/Configuration/AssemblyInfo.cs
  11. 105
      src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.addin
  12. 89
      src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.csproj
  13. 3
      src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.csproj.user
  14. BIN
      src/AddIns/Misc/HtmlHelp2/Project/Resources/Favorites.16x16.Delete.bmp
  15. BIN
      src/AddIns/Misc/HtmlHelp2/Project/Resources/Favorites.16x16.MoveDown.bmp
  16. BIN
      src/AddIns/Misc/HtmlHelp2/Project/Resources/Favorites.16x16.MoveUp.bmp
  17. BIN
      src/AddIns/Misc/HtmlHelp2/Project/Resources/Favorites.16x16.Rename.bmp
  18. BIN
      src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.AddToFavorites.png
  19. BIN
      src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.Back.png
  20. BIN
      src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.Forward.png
  21. BIN
      src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.Home.gif
  22. BIN
      src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.NewWindow.png
  23. BIN
      src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.NextTopic.png
  24. BIN
      src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.PrevTopic.png
  25. BIN
      src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.Refresh.png
  26. BIN
      src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.SearchSite.gif
  27. BIN
      src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.Stop.png
  28. BIN
      src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.SyncToc.png
  29. BIN
      src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.TextZoom.png
  30. 35
      src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2Options.xfrm
  31. 308
      src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/DynamicHelpPad.cs
  32. 302
      src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/FavoritesPad.cs
  33. 295
      src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/IndexPad.cs
  34. 148
      src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/IndexResultsPad.cs
  35. 299
      src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/SearchPad.cs
  36. 161
      src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/SearchResultsPad.cs
  37. 357
      src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/TocPad.cs
  38. 376
      src/AddIns/Misc/HtmlHelp2/Project/src/BrowserControl/Browser.cs
  39. 98
      src/AddIns/Misc/HtmlHelp2/Project/src/BrowserControl/ShowHelpBrowser.cs
  40. 764
      src/AddIns/Misc/HtmlHelp2/Project/src/Service/AxMSHelpControls.cs
  41. 47
      src/AddIns/Misc/HtmlHelp2/Project/src/Service/Help2ControlsValidation.cs
  42. 89
      src/AddIns/Misc/HtmlHelp2/Project/src/Service/Help2RegistryWalker.cs
  43. 111
      src/AddIns/Misc/HtmlHelp2/Project/src/Service/HtmlHelp2Dialog.cs
  44. 87
      src/AddIns/Misc/HtmlHelp2/Project/src/Service/HtmlHelp2Options.cs
  45. 317
      src/AddIns/Misc/HtmlHelp2/Project/src/Service/HtmlHelp2Service.cs
  46. 43
      src/AddIns/Misc/HtmlHelp2/Project/src/Service/ResourcesHelper.cs
  47. 769
      src/AddIns/Misc/HtmlHelp2/RequiredLibraries/AxMSHelpControls.cs
  48. BIN
      src/AddIns/Misc/HtmlHelp2/RequiredLibraries/MSHelpControls.dll
  49. BIN
      src/AddIns/Misc/HtmlHelp2/RequiredLibraries/MSHelpServices.dll
  50. 15
      src/AddIns/Misc/HtmlHelp2/RequiredLibraries/import.bat
  51. 16
      src/AddIns/Misc/HtmlHelp2/RequiredLibraries/import.txt
  52. BIN
      src/AddIns/Misc/HtmlHelp2/RequiredLibraries/stdole.dll
  53. BIN
      src/Main/StartUp/Project/Resources/BitmapResources.resources
  54. 3
      src/SharpDevelop.sln

12
data/resources/image/BitmapResources/BitmapResources.res

@ -417,3 +417,15 @@ Icons.16x16.XSLIcon = backendicons\miscFiles\XSL_16.png @@ -417,3 +417,15 @@ Icons.16x16.XSLIcon = backendicons\miscFiles\XSL_16.png
Icons.32x32.XSLIcon = backendicons\miscFiles\XSL_32.png
Icons.16x16.ASPFileIcon = backendicons\miscFiles\ASP_16.png
Icons.32x32.ASPFileIcon = backendicons\miscFiles\ASP_32.png
HtmlHelp2.16x16.DynamicHelp = PadIcons\HtmlHelp2.16x16.DynamicHelp.png
HtmlHelp2.16x16.Favorites = PadIcons\HtmlHelp2.16x16.Favorites.png
HtmlHelp2.16x16.Index = PadIcons\HtmlHelp2.16x16.Index.png
HtmlHelp2.16x16.IndexResults = PadIcons\HtmlHelp2.16x16.IndexResults.png
HtmlHelp2.16x16.Search = PadIcons\HtmlHelp2.16x16.Search.png
HtmlHelp2.16x16.SearchResults = PadIcons\HtmlHelp2.16x16.SearchResults.png
HtmlHelp2.16x16.Toc = PadIcons\HtmlHelp2.16x16.Toc.png

BIN
data/resources/image/BitmapResources/PadIcons/HtmlHelp2.16x16.DynamicHelp.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

BIN
data/resources/image/BitmapResources/PadIcons/HtmlHelp2.16x16.Favorites.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

BIN
data/resources/image/BitmapResources/PadIcons/HtmlHelp2.16x16.Index.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

BIN
data/resources/image/BitmapResources/PadIcons/HtmlHelp2.16x16.IndexResults.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 B

BIN
data/resources/image/BitmapResources/PadIcons/HtmlHelp2.16x16.Search.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

BIN
data/resources/image/BitmapResources/PadIcons/HtmlHelp2.16x16.SearchResults.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

BIN
data/resources/image/BitmapResources/PadIcons/HtmlHelp2.16x16.Toc.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

6
src/AddIns/Misc/HtmlHelp2/HtmlHelp2.sln

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.0.0.280
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HtmlHelp2", "Project\HtmlHelp2.csproj", "{918487B7-2153-4618-BBB3-344DBDDF2A2A}"
EndProject
Global
EndGlobal

32
src/AddIns/Misc/HtmlHelp2/Project/Configuration/AssemblyInfo.cs

@ -0,0 +1,32 @@ @@ -0,0 +1,32 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
[assembly: AssemblyTitle("Microsoft Help 2.0 Environment")]
[assembly: AssemblyDescription("Integrates Microsoft Help 2.0 in SharpDevelop")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Cube")]
[assembly: AssemblyProduct("SharpDevelop")]
[assembly: AssemblyCopyright("Copyright © 2005 Mathias Simmack")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("2.0.0.4")]
// The following attributes specify the key for the sign of your assembly. See the
// .NET Framework documentation for more information about signing.
// This is not required, if you don't want signing let these attributes like they're.
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]

105
src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.addin

@ -0,0 +1,105 @@ @@ -0,0 +1,105 @@
<AddIn name = "Help 2.0 Environment for SharpDevelop"
author = "Mathias Simmack"
copyright = "Copyright (c) 2005"
url = "unknown"
description = "integrates Microsoft's Help 2.0 Environment"
version = "2.0.0.2">
<Runtime>
<Import assembly="HtmlHelp2.dll"/>
</Runtime>
<Path name = "/SharpDevelop/Workbench/Pads">
<Pad id = "TocPad"
category = "Help2"
title = "${res:AddIns.HtmlHelp2.Contents}"
icon = "HtmlHelp2.16x16.Toc"
class = "HtmlHelp2.HtmlHelp2TocPad"/>
<Pad id = "IndexPad"
category = "Help2"
title = "${res:AddIns.HtmlHelp2.Index}"
icon = "HtmlHelp2.16x16.Index"
class = "HtmlHelp2.HtmlHelp2IndexPad"/>
<Pad id = "SearchPad"
category = "Help2"
title = "${res:AddIns.HtmlHelp2.Search}"
icon = "HtmlHelp2.16x16.Search"
class = "HtmlHelp2.HtmlHelp2SearchPad"/>
<Pad id = "FavoritesPad"
category = "Help2"
title = "${res:AddIns.HtmlHelp2.Favorites}"
icon = "HtmlHelp2.16x16.Favorites"
class = "HtmlHelp2.HtmlHelp2FavoritesPad"/>
<Pad id = "IndexResultsPad"
category = "Help2"
title = "${res:AddIns.HtmlHelp2.IndexResults}"
icon = "HtmlHelp2.16x16.IndexResults"
class = "HtmlHelp2.HtmlHelp2IndexResultsPad"/>
<Pad id = "SearchResultsPad"
category = "Help2"
title = "${res:AddIns.HtmlHelp2.SearchResults}"
icon = "HtmlHelp2.16x16.SearchResults"
class = "HtmlHelp2.HtmlHelp2SearchResultsPad"/>
</Path>
<Path name = "/SharpDevelop/Dialogs/OptionsDialog/ToolsOptions">
<DialogPanel id = "HtmlHelp2Options"
label = "${res:AddIns.HtmlHelp2.Environment}"
class = "HtmlHelp2Service.HtmlHelp2OptionsPanel"/>
</Path>
<Path name = "/SharpDevelop/Workbench/MainMenu/Help">
<!-- <MenuItem id = "DynamicHelpPadCommand"
insertafter = "DynamicHelp"
label = "${res:AddIns.HtmlHelp2.DynamicHelp}"
icon = "HtmlHelp2.16x16.DynamicHelp"
shortcut = "Control|F1"
class = "HtmlHelp2.ShowDynamicHelpMenuCommand"/> -->
<MenuItem id = "TocPadCommand"
insertafter = "DynamicHelp"
label = "${res:AddIns.HtmlHelp2.Contents}"
icon = "HtmlHelp2.16x16.Toc"
shortcut = "Control|Alt|F1"
class = "HtmlHelp2.ShowTocMenuCommand"/>
<MenuItem id = "IndexPadCommand"
label = "${res:AddIns.HtmlHelp2.Index}"
icon = "HtmlHelp2.16x16.Index"
shortcut = "Control|Alt|F2"
class = "HtmlHelp2.ShowIndexMenuCommand"
insertafter = "TocPadCommand"/>
<MenuItem id = "SearchPadCommand"
label = "${res:AddIns.HtmlHelp2.SearchCommand}"
icon = "HtmlHelp2.16x16.Search"
shortcut = "Control|Alt|F3"
class = "HtmlHelp2.ShowSearchMenuCommand"
insertafter = "IndexPadCommand"/>
<MenuItem id = "FavoritesPadCommand"
label = "${res:AddIns.HtmlHelp2.Favorites}"
icon = "HtmlHelp2.16x16.Favorites"
shortcut = "Control|Alt|F"
class = "HtmlHelp2.ShowFavoritesMenuCommand"
insertafter = "SearchPadCommand"/>
<MenuItem id = "HtmlHelp2Separator2"
type = "Separator"
insertafter = "FavoritesPadCommand"/>
<MenuItem id = "IndexResultsPadCommand"
label = "${res:AddIns.HtmlHelp2.IndexResults}"
icon = "HtmlHelp2.16x16.IndexResults"
shortcut = "Shift|Alt|F2"
class = "HtmlHelp2.ShowIndexResultsMenuCommand"
insertafter = "HtmlHelp2Separator2"/>
<MenuItem id = "SearchResultsPadCommand"
label = "${res:AddIns.HtmlHelp2.SearchResults}"
icon = "HtmlHelp2.16x16.SearchResults"
shortcut = "Shift|Alt|F3"
class = "HtmlHelp2.ShowSearchResultsMenuCommand"
insertbefore = "Separator1"
insertafter = "IndexResultsPadCommand"/>
</Path>
<!--<Path name = "/SharpDevelop/Workbench/DisplayBindings">
<DisplayBinding id = "HtmlHelp2BrowserControlBinding"
supportedformats = "Web Pages"
class = "HtmlHelp2Browser.HtmlHelp2BrowserControlBinding"/>
</Path> -->
</AddIn>

89
src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.csproj

@ -0,0 +1,89 @@ @@ -0,0 +1,89 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputType>Library</OutputType>
<RootNamespace>HtmlHelp2</RootNamespace>
<AssemblyName>HtmlHelp2</AssemblyName>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{918487B7-2153-4618-BBB3-344DBDDF2A2A}</ProjectGuid>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\..\..\..\AddIns\AddIns\Misc\HtmlHelp2\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>..\..\..\..\..\AddIns\AddIns\Misc\HtmlHelp2\</OutputPath>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="stdole">
<HintPath>..\RequiredLibraries\stdole.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="MSHelpControls">
<HintPath>..\RequiredLibraries\MSHelpControls.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="MSHelpServices">
<HintPath>..\RequiredLibraries\MSHelpServices.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</ItemGroup>
<ItemGroup>
<Compile Include="src\BaseControls\TocPad.cs" />
<None Include="src\BaseControls\DynamicHelpPad.cs" />
<Compile Include="src\BaseControls\FavoritesPad.cs" />
<Compile Include="src\BaseControls\IndexPad.cs" />
<Compile Include="src\BaseControls\IndexResultsPad.cs" />
<Compile Include="src\BaseControls\SearchPad.cs" />
<Compile Include="src\BaseControls\SearchResultsPad.cs" />
<Compile Include="src\BrowserControl\Browser.cs" />
<Compile Include="src\BrowserControl\ShowHelpBrowser.cs" />
<None Include="HtmlHelp2.addin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Compile Include="src\Service\Help2RegistryWalker.cs" />
<Compile Include="src\Service\HtmlHelp2Dialog.cs" />
<Compile Include="src\Service\HtmlHelp2Service.cs" />
<Compile Include="src\Service\ResourcesHelper.cs" />
<Compile Include="src\Service\Help2ControlsValidation.cs" />
<Compile Include="src\Service\AxMSHelpControls.cs" />
<Compile Include="src\Service\HtmlHelp2Options.cs" />
<Compile Include="Configuration\AssemblyInfo.cs" />
<EmbeddedResource Include="Resources\Favorites.16x16.Delete.bmp" />
<EmbeddedResource Include="Resources\Favorites.16x16.MoveDown.bmp" />
<EmbeddedResource Include="Resources\Favorites.16x16.MoveUp.bmp" />
<EmbeddedResource Include="Resources\Favorites.16x16.Rename.bmp" />
<EmbeddedResource Include="Resources\HtmlHelp2Options.xfrm" />
<EmbeddedResource Include="Resources\HtmlHelp2.16x16.TextZoom.png" />
<EmbeddedResource Include="Resources\HtmlHelp2.16x16.AddToFavorites.png" />
<EmbeddedResource Include="Resources\HtmlHelp2.16x16.Back.png" />
<EmbeddedResource Include="Resources\HtmlHelp2.16x16.Forward.png" />
<EmbeddedResource Include="Resources\HtmlHelp2.16x16.Home.gif" />
<EmbeddedResource Include="Resources\HtmlHelp2.16x16.NewWindow.png" />
<EmbeddedResource Include="Resources\HtmlHelp2.16x16.NextTopic.png" />
<EmbeddedResource Include="Resources\HtmlHelp2.16x16.PrevTopic.png" />
<EmbeddedResource Include="Resources\HtmlHelp2.16x16.Refresh.png" />
<EmbeddedResource Include="Resources\HtmlHelp2.16x16.SearchSite.gif" />
<EmbeddedResource Include="Resources\HtmlHelp2.16x16.Stop.png" />
<EmbeddedResource Include="Resources\HtmlHelp2.16x16.SyncToc.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project>
<Name>ICSharpCode.SharpDevelop</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj">
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project>
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
</Project>

3
src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.csproj.user

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
</Project>

BIN
src/AddIns/Misc/HtmlHelp2/Project/Resources/Favorites.16x16.Delete.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

BIN
src/AddIns/Misc/HtmlHelp2/Project/Resources/Favorites.16x16.MoveDown.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

BIN
src/AddIns/Misc/HtmlHelp2/Project/Resources/Favorites.16x16.MoveUp.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

BIN
src/AddIns/Misc/HtmlHelp2/Project/Resources/Favorites.16x16.Rename.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

BIN
src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.AddToFavorites.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

BIN
src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.Back.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

BIN
src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.Forward.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

BIN
src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.Home.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 1020 B

BIN
src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.NewWindow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

BIN
src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.NextTopic.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

BIN
src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.PrevTopic.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

BIN
src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.Refresh.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

BIN
src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.SearchSite.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.Stop.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

BIN
src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.SyncToc.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

BIN
src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2.16x16.TextZoom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

35
src/AddIns/Misc/HtmlHelp2/Project/Resources/HtmlHelp2Options.xfrm

@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
<Components version="1.0">
<System.Windows.Forms.UserControl>
<Name value="HtmlHelp2Options" />
<DockPadding value="" />
<ClientSize value="{Width=360, Height=320}" />
<Controls>
<System.Windows.Forms.GroupBox>
<Name value="groupBox1" />
<TabIndex value="0" />
<Location value="{X=8,Y=8}" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=344, Height=112}" />
<Text value="${res:AddIns.HtmlHelp2.Options.Groupbox}" />
<Controls>
<System.Windows.Forms.ComboBox>
<Name value="help2Collections" />
<Anchor value="Top, Left, Right" />
<TabIndex value="1" />
<Location value="{X=16,Y=80}" />
<Size value="{Width=312, Height=21}" />
<DropDownStyle value="DropDownList" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.Label>
<Name value="label1" />
<Text value="${res:AddIns.HtmlHelp2.Options.Label}" />
<Anchor value="Top, Left, Right" />
<TabIndex value="0" />
<Size value="{Width=312, Height=45}" />
<Location value="{X=16,Y=27}" />
</System.Windows.Forms.Label>
</Controls>
</System.Windows.Forms.GroupBox>
</Controls>
</System.Windows.Forms.UserControl>
</Components>

308
src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/DynamicHelpPad.cs

@ -0,0 +1,308 @@ @@ -0,0 +1,308 @@
/* ***********************************************************
*
* Help 2.0 Environment for SharpDevelop
* Dynamic Help Pad
* Copyright (c) 2005, Mathias Simmack. All rights reserved.
*
* ********************************************************* */
namespace HtmlHelp2
{
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Reflection;
using System.IO;
using ICSharpCode.Core.AddIns;
using ICSharpCode.Core.AddIns.Codons;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.Core.Services;
using ICSharpCode.SharpDevelop.BrowserDisplayBinding;
using ICSharpCode.SharpDevelop.Services;
using HtmlHelp2Service;
using HtmlHelp2Browser;
using MSHelpServices;
using mshtml;
/*
* Note: The dynamic help is disabled at the moment. Technically it's
* possible. You can patch the default editor, trying to integrate the
* dynamic help. :o) But if you are doing so, don't forget to use the
* second version of "HtmlHelp2.addin", located in the "DynamicHelpResources"
* folder.
*
* Mathias.
*/
public class ShowDynamicHelpMenuCommand : AbstractMenuCommand
{
public override void Run()
{
HtmlHelp2DynamicHelpPad dynamicHelp = (HtmlHelp2DynamicHelpPad)WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2DynamicHelpPad));
if(dynamicHelp != null) dynamicHelp.BringPadToFront();
}
}
public class HtmlHelp2DynamicHelpPad : AbstractPadContent
{
protected HtmlHelp2DynamicHelpBrowserControl dynamicHelpBrowser;
HtmlHelp2Environment h2env = null;
int internalIndex = 0;
public override Control Control
{
get {
return dynamicHelpBrowser;
}
}
public override void Dispose()
{
try {
dynamicHelpBrowser.Dispose();
}
catch {
}
}
public override void RedrawContent()
{
dynamicHelpBrowser.RedrawContent();
}
public HtmlHelp2DynamicHelpPad() : base("${res:AddIns.HtmlHelp2.DynamicHelp}", "HtmlHelp2.16x16.DynamicHelp")
{
h2env = (HtmlHelp2Environment)ServiceManager.Services.GetService(typeof(HtmlHelp2Environment));
dynamicHelpBrowser = new HtmlHelp2DynamicHelpBrowserControl();
}
#region WebBrowser Scripting
public void BuildDynamicHelpList(string dynamicHelpString, string expectedLanguage)
{
if(h2env == null || !h2env.Help2EnvironmentIsReady || h2env.DynamicHelpIsBusy) {
return;
}
this.BringPadToFront();
try {
this.RemoveAllChildren();
Cursor.Current = Cursors.WaitCursor;
IHxTopicList topics = h2env.GetMatchingTopicsForDynamicHelp(dynamicHelpString);
Cursor.Current = Cursors.Default;
if(topics.Count > 0) {
for(int i = 1; i <= topics.Count; i++) {
IHxTopic topic = topics.ItemAt(i);
if(expectedLanguage == null || expectedLanguage == "" || topic.HasAttribute("DevLang", expectedLanguage)) {
this.BuildNewChild(topic.Location,
topic.get_Title(HxTopicGetTitleType.HxTopicGetRLTitle,HxTopicGetTitleDefVal.HxTopicGetTitleFileName),
topic.URL);
}
}
}
}
catch {
}
}
private void RemoveAllChildren()
{
try {
dynamicHelpBrowser.Document.body.innerHTML = "";
this.internalIndex = 0;
}
catch {
}
}
private void BuildNewChild(string sectionName, string topicName, string topicUrl)
{
mshtml.IHTMLElementCollection children = (mshtml.IHTMLElementCollection)((mshtml.IHTMLElement2)dynamicHelpBrowser.Document.body).getElementsByTagName("span");
for(int i = 0; i < children.length; i++) {
mshtml.IHTMLElement span = (mshtml.IHTMLElement)children.item(i,0);
if((string)span.getAttribute("className", 0) == "section") {
try {
mshtml.IHTMLElementCollection spanChildren = (mshtml.IHTMLElementCollection)span.children;
mshtml.IHTMLElement firstChild = (mshtml.IHTMLElement)spanChildren.item(1,0);
mshtml.IHTMLElement spanChild = (mshtml.IHTMLElement)spanChildren.item(3,0);
if(firstChild.tagName == "B" && firstChild.innerText == sectionName) {
if(spanChild.tagName == "SPAN" && (string)spanChild.getAttribute("className", 0) == "content") {
spanChild.insertAdjacentHTML("beforeEnd",
String.Format("<span class=\"link\" onmouseover=\"window.status='{0}'\" onmouseout=\"window.status=''\" onclick=\"Click('{0}');\">{1}</span><br>",
topicUrl, topicName)
);
return;
}
}
}
finally {
}
}
}
try {
if(children.length > 0) {
dynamicHelpBrowser.Document.body.insertAdjacentHTML("beforeEnd", "<br>");
}
dynamicHelpBrowser.Document.body.insertAdjacentHTML("beforeEnd",
String.Format("<span class=\"section\"><img id=\"image_{0}\" src=\"OpenBook.png\" style=\"width:16px;height:16px;margin-right:5px;\">" +
"<b style=\"cursor:pointer\" onclick=\"ExpandCollapse({0})\">{1}</b><br>" +
"<span class=\"content\" id=\"content_{0}\">" +
"<span class=\"link\" onmouseover=\"window.status='{2}'\" onmouseout=\"window.status=''\" onclick=\"Click('{2}');\">{3}</span><br></span></span>",
this.internalIndex.ToString(), sectionName, topicUrl, topicName)
);
this.internalIndex++;
}
finally {
}
}
#endregion
}
public class HtmlHelp2DynamicHelpBrowserControl : UserControl
{
AxWebBrowser axWebBrowser = null;
ToolBar dynamicHelpToolbar = new ToolBar();
mshtml.HTMLDocument doc = null;
string[] toolbarButtons = new string[] {
"${res:AddIns.HtmlHelp2.Contents}",
"${res:AddIns.HtmlHelp2.Index}",
"${res:AddIns.HtmlHelp2.Search}"
};
public mshtml.HTMLDocument Document
{
get {
return doc;
}
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (disposing) axWebBrowser.Dispose();
}
public void RedrawContent()
{
StringParserService sps = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
for(int i = 0; i < toolbarButtons.Length; i++) {
dynamicHelpToolbar.Buttons[i].ToolTipText = sps.Parse(toolbarButtons[i]);
}
}
public HtmlHelp2DynamicHelpBrowserControl()
{
HtmlHelp2Environment h2env = (HtmlHelp2Environment)ServiceManager.Services.GetService(typeof(HtmlHelp2Environment));
bool Help2EnvIsReady = (h2env != null && h2env.Help2EnvironmentIsReady);
Dock = DockStyle.Fill;
Size = new Size(500, 500);
axWebBrowser = new AxWebBrowser();
axWebBrowser.BeginInit();
axWebBrowser.Dock = DockStyle.Fill;
axWebBrowser.Enabled = Help2EnvIsReady;
axWebBrowser.HandleCreated += new EventHandler(this.CreatedWebBrowserHandle);
axWebBrowser.NewWindow2 += new DWebBrowserEvents2_NewWindow2EventHandler(this.NewBrowserWindow);
axWebBrowser.StatusTextChange += new DWebBrowserEvents2_StatusTextChangeEventHandler(this.StatusBarChanged);
axWebBrowser.DocumentComplete += new DWebBrowserEvents2_DocumentCompleteEventHandler(this.DocumentComplete);
axWebBrowser.EndInit();
Controls.Add(axWebBrowser);
Controls.Add(dynamicHelpToolbar);
dynamicHelpToolbar.Dock = DockStyle.Top;
dynamicHelpToolbar.Appearance = ToolBarAppearance.Flat;
dynamicHelpToolbar.Divider = false;
dynamicHelpToolbar.ButtonClick += new ToolBarButtonClickEventHandler(ToolBarButtonClicked);
StringParserService sps = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
for(int i = 0; i < toolbarButtons.Length; i++) {
ToolBarButton button = new ToolBarButton();
button.ToolTipText = sps.Parse(toolbarButtons[i]);
button.ImageIndex = i;
dynamicHelpToolbar.Buttons.Add(button);
}
dynamicHelpToolbar.ImageList = new ImageList();
dynamicHelpToolbar.ImageList.ColorDepth = ColorDepth.Depth32Bit;
dynamicHelpToolbar.ImageList.Images.Add(ResourcesHelper.GetImage("HtmlHelp2.16x16.Toc"));
dynamicHelpToolbar.ImageList.Images.Add(ResourcesHelper.GetImage("HtmlHelp2.16x16.Index"));
dynamicHelpToolbar.ImageList.Images.Add(ResourcesHelper.GetImage("HtmlHelp2.16x16.Search"));
}
private void CreatedWebBrowserHandle(object sender, EventArgs evArgs)
{
object arg = System.Reflection.Missing.Value;
try {
string url = "about:blank";
if(File.Exists(String.Format("{0}\\context.html",Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)))) {
url = String.Format("file://{0}\\context.html",Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
}
axWebBrowser.Navigate(url, ref arg, ref arg, ref arg, ref arg);
} catch {
}
}
private void NewBrowserWindow(object sender, DWebBrowserEvents2_NewWindow2Event e)
{
HtmlHelp2BrowserPane help2Browser = ShowHelpBrowser.GetActiveHelp2BrowserView();
help2Browser.WorkbenchWindow.SelectWindow();
AxWebBrowser newBrowser = (AxWebBrowser)((HtmlHelp2BrowserControl)help2Browser.Control).AxWebBrowser;
e.ppDisp = newBrowser.Application;
newBrowser.RegisterAsBrowser = true;
}
private void DocumentComplete(object sender, DWebBrowserEvents2_DocumentCompleteEvent e)
{
try {
doc = (mshtml.HTMLDocument)axWebBrowser.Document;
mshtml.HTMLDocumentEvents2_Event docEvents = (mshtml.HTMLDocumentEvents2_Event)doc;
docEvents.oncontextmenu += new HTMLDocumentEvents2_oncontextmenuEventHandler(DocumentEventsOnContextMenu);
}
catch {
}
}
private void StatusBarChanged(object sender, DWebBrowserEvents2_StatusTextChangeEvent e)
{
IStatusBarService statusBarService = (IStatusBarService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(IStatusBarService));
statusBarService.SetMessage(e.text);
}
private bool DocumentEventsOnContextMenu(IHTMLEventObj e)
{
e.cancelBubble = true;
e.returnValue = false;
return false;
}
private void ToolBarButtonClicked(object sender, ToolBarButtonClickEventArgs e)
{
switch(dynamicHelpToolbar.Buttons.IndexOf(e.Button)) {
case 0:
HtmlHelp2TocPad toc = (HtmlHelp2TocPad)WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2TocPad));
if(toc != null) toc.BringPadToFront();
break;
case 1:
HtmlHelp2IndexPad index = (HtmlHelp2IndexPad)WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2IndexPad));
if(index != null) index.BringPadToFront();
break;
case 2:
HtmlHelp2SearchPad search = (HtmlHelp2SearchPad)WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2SearchPad));
if(search != null) search.BringPadToFront();
break;
}
}
}
}

302
src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/FavoritesPad.cs

@ -0,0 +1,302 @@ @@ -0,0 +1,302 @@
/* ***********************************************************
*
* Help 2.0 Environment for SharpDevelop
* Favorites Pad
* Copyright (c) 2005, Mathias Simmack. All rights reserved.
*
* ********************************************************* */
namespace HtmlHelp2
{
using System;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
using System.Xml;
using System.Collections;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
using HtmlHelp2Service;
public class ShowFavoritesMenuCommand : AbstractMenuCommand
{
public override void Run()
{
PadDescriptor favorites = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2FavoritesPad));
if(favorites != null) favorites.BringPadToFront();
}
}
public class HtmlHelp2FavoritesPad : AbstractPadContent
{
const string help2FavoritesFile = "help2favorites.xml";
string[] toolbarButtons = new string[] {
"${res:AddIns.HtmlHelp2.MoveUp}",
"${res:AddIns.HtmlHelp2.MoveDown}",
"${res:AddIns.HtmlHelp2.Rename}",
"${res:AddIns.HtmlHelp2.Delete}"
};
bool Help2EnvIsReady = false;
Panel mainPanel = new Panel();
TreeView tv = new TreeView();
ToolStrip toolStrip = new ToolStrip();
public override Control Control
{
get {
return mainPanel;
}
}
public override void RedrawContent()
{
for(int i = 0; i < toolbarButtons.Length; i++) {
toolStrip.Items[i].ToolTipText = StringParser.Parse(toolbarButtons[i]);
}
}
public HtmlHelp2FavoritesPad()
{
this.InitializeComponents();
}
private void InitializeComponents()
{
Help2EnvIsReady = HtmlHelp2Environment.IsReady;
mainPanel.Controls.Add(tv);
tv.Dock = DockStyle.Fill;
tv.Enabled = Help2EnvIsReady;
tv.ShowLines = false;
tv.ShowRootLines = false;
tv.LabelEdit = true;
tv.HideSelection = false;
tv.AfterSelect += new TreeViewEventHandler(this.TreeNodeAfterSelect);
tv.BeforeLabelEdit += new NodeLabelEditEventHandler(this.BeforeLabelEdit);
tv.AfterLabelEdit += new NodeLabelEditEventHandler(this.AfterLabelEdit);
tv.KeyDown += new KeyEventHandler(this.TreeViewKeyDown);
tv.DoubleClick += new EventHandler(this.TreeNodeDoubleClick);
mainPanel.Controls.Add(toolStrip);
toolStrip.Dock = DockStyle.Top;
toolStrip.Enabled = Help2EnvIsReady;
toolStrip.AllowItemReorder = false;
for(int i = 0; i < toolbarButtons.Length; i++) {
ToolStripButton button = new ToolStripButton();
button.ToolTipText = StringParser.Parse(toolbarButtons[i]);
button.ImageIndex = i;
button.Enabled = false;
button.Click += new EventHandler(this.ToolStripButtonClicked);
toolStrip.Items.Add(button);
}
toolStrip.ImageList = new ImageList();
toolStrip.ImageList.ColorDepth = ColorDepth.Depth4Bit;
toolStrip.ImageList.TransparentColor = Color.Red;
toolStrip.ImageList.Images.Add(ResourcesHelper.GetBitmap("Favorites.16x16.MoveUp.bmp"));
toolStrip.ImageList.Images.Add(ResourcesHelper.GetBitmap("Favorites.16x16.MoveDown.bmp"));
toolStrip.ImageList.Images.Add(ResourcesHelper.GetBitmap("Favorites.16x16.Rename.bmp"));
toolStrip.ImageList.Images.Add(ResourcesHelper.GetBitmap("Favorites.16x16.Delete.bmp"));
if(Help2EnvIsReady) this.LoadFavorites();
}
#region TreeView
private void TreeNodeAfterSelect(object sender, TreeViewEventArgs e)
{
TreeNode tn = tv.SelectedNode;
toolStrip.Items[0].Enabled = (tn != null && tn.PrevNode != null);
toolStrip.Items[1].Enabled = (tn != null && tn.NextNode != null);
toolStrip.Items[2].Enabled = (tn != null);
toolStrip.Items[3].Enabled = (tn != null);
}
private void BeforeLabelEdit(object sender, NodeLabelEditEventArgs e)
{
e.CancelEdit = (e.Node == null);
}
private void AfterLabelEdit(object Sender, NodeLabelEditEventArgs e)
{
if(e.Label != null && e.Label.Length > 0) {
if(e.Node.Tag != null && e.Node.Tag is string && (string)e.Node.Tag != "") {
this.PatchFavoriteName(e.Label.ToString(), (string)e.Node.Tag);
}
}
}
private void TreeViewKeyDown(object sender, KeyEventArgs e)
{
if(tv.SelectedNode != null) {
switch(e.KeyCode) {
case Keys.F2:
tv.SelectedNode.BeginEdit();
break;
case Keys.Delete:
tv.Nodes.Remove(tv.SelectedNode);
this.SaveFavorites();
break;
}
}
}
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);
}
}
#endregion
#region ToolStrip
private void ToolStripButtonClicked(object sender, EventArgs e)
{
if(tv.SelectedNode == null) return;
ToolStripItem item = (ToolStripItem)sender;
TreeNode tempNode = null;
switch(item.ImageIndex) {
case 0:
tempNode = (TreeNode)tv.SelectedNode.Clone();
tv.Nodes.Insert(tv.SelectedNode.PrevNode.Index, tempNode);
tv.Nodes.Remove(tv.SelectedNode);
tv.SelectedNode = tempNode;
this.SaveFavorites();
break;
case 1:
tempNode = (TreeNode)tv.SelectedNode.Clone();
TreeNode nextNextNode = tv.SelectedNode.NextNode.NextNode;
if(nextNextNode == null) tv.Nodes.Add(tempNode);
else tv.Nodes.Insert(nextNextNode.Index, tempNode);
tv.Nodes.Remove(tv.SelectedNode);
tv.SelectedNode = tempNode;
this.SaveFavorites();
break;
case 2:
tv.SelectedNode.BeginEdit();
break;
case 3:
string text = StringParser.Parse("${res:AddIns.HtmlHelp2.RemoveFavorite}", new string[,] {{"0", tv.SelectedNode.Text}});
DialogResult result = MessageBox.Show(text,
StringParser.Parse("${res:MainWindow.Windows.HelpScoutLabel}"),
MessageBoxButtons.YesNo,
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button2);
if(result == DialogResult.Yes) {
tv.Nodes.Remove(tv.SelectedNode);
this.SaveFavorites();
}
break;
}
this.TreeNodeAfterSelect(null, null);
}
#endregion
#region Favorites
private void LoadFavorites()
{
tv.Nodes.Clear();
tv.BeginUpdate();
try {
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(PropertyService.ConfigDirectory + help2FavoritesFile);
XmlNodeList nl = xmldoc.SelectNodes("favorites/favorite");
for(int i = 0; i < nl.Count; i++) {
XmlNode title = nl.Item(i).SelectSingleNode("title");
XmlNode url = nl.Item(i).SelectSingleNode("url");
if(title != null && url != null && title.InnerText != "" && url.InnerText != "") {
TreeNode node = new TreeNode();
node.Text = title.InnerText;
node.Tag = url.InnerText;
tv.Nodes.Add(node);
}
}
}
catch {
}
tv.EndUpdate();
}
private void SaveFavorites()
{
try {
XmlDocument xmldoc = new XmlDocument();
xmldoc.LoadXml("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><favorites/>");
foreach(TreeNode node in tv.Nodes) {
if(node.Text != "" && node.Tag != null && node.Tag is string && (string)node.Tag != "") {
XmlNode favorite = xmldoc.CreateElement("favorite");
XmlNode title = xmldoc.CreateElement("title");
title.InnerText = node.Text;
favorite.AppendChild(title);
XmlCDataSection cdata = xmldoc.CreateCDataSection((string)node.Tag);
XmlNode url = xmldoc.CreateElement("url");
url.AppendChild(cdata);
favorite.AppendChild(url);
xmldoc.DocumentElement.AppendChild(favorite);
}
}
xmldoc.Save(PropertyService.ConfigDirectory + help2FavoritesFile);
}
catch {
}
}
private void PatchFavoriteName(string newName, string topicUrl)
{
try {
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(PropertyService.ConfigDirectory + help2FavoritesFile);
XmlNode node = xmldoc.SelectSingleNode(String.Format("/favorites/favorite[url=\"{0}\"]/title", topicUrl));
if(node != null) {
node.InnerText = newName;
xmldoc.Save(PropertyService.ConfigDirectory + help2FavoritesFile);
}
}
catch {
}
}
public void AddToFavorites(string topicName, string topicUrl)
{
if(Help2EnvIsReady && topicName != "" && topicUrl != "") {
bool urlFound = false;
foreach(TreeNode node in tv.Nodes) {
if(node.Tag != null && node.Tag is string && String.Compare(topicUrl, (string)node.Tag) == 0) {
urlFound = true;
break;
}
}
if(!urlFound) {
TreeNode node = new TreeNode();
node.Text = topicName;
node.Tag = topicUrl;
tv.Nodes.Add(node);
this.SaveFavorites();
}
}
}
#endregion
}
}

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

@ -0,0 +1,295 @@ @@ -0,0 +1,295 @@
/* ***********************************************************
*
* Help 2.0 Environment for SharpDevelop
* Index Pad
* Copyright (c) 2005, Mathias Simmack. All rights reserved.
*
* ********************************************************* */
namespace HtmlHelp2
{
using System;
using System.Drawing;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
using AxMSHelpControls;
using MSHelpControls;
using MSHelpServices;
using HtmlHelp2Service;
using HtmlHelp2Browser;
public class ShowIndexMenuCommand : AbstractMenuCommand
{
public override void Run()
{
PadDescriptor index = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2IndexPad));
if(index != null) index.BringPadToFront();
}
}
public class HtmlHelp2IndexPad : AbstractPadContent
{
protected MsHelp2IndexControl help2IndexControl;
public override Control Control
{
get {
return help2IndexControl;
}
}
public override void Dispose()
{
help2IndexControl.Dispose();
}
public override void RedrawContent()
{
help2IndexControl.RedrawContent();
}
public HtmlHelp2IndexPad()
{
help2IndexControl = new MsHelp2IndexControl();
help2IndexControl.LoadIndex();
}
}
public class MsHelp2IndexControl : UserControl
{
AxHxIndexCtrl indexControl = null;
ComboBox filterCombobox = new ComboBox();
ComboBox searchTerm = new ComboBox();
Label label1 = new Label();
Label label2 = new Label();
bool itemClicked = false;
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if(disposing && indexControl != null) {
indexControl.Dispose();
}
}
public void RedrawContent()
{
label1.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.FilteredBy}");
label2.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.LookFor}");
}
public MsHelp2IndexControl()
{
bool Help2EnvIsReady = (HtmlHelp2Environment.IsReady && Help2ControlsValidation.IsIndexControlRegistered);
if(Help2EnvIsReady) {
try {
indexControl = new AxHxIndexCtrl();
indexControl.BeginInit();
indexControl.Dock = DockStyle.Fill;
indexControl.ItemClick += new AxMSHelpControls.IHxIndexViewEvents_ItemClickEventHandler(this.IndexItemClicked);
indexControl.EndInit();
Controls.Add(indexControl);
indexControl.CreateControl();
indexControl.BorderStyle = HxBorderStyle.HxBorderStyle_FixedSingle;
indexControl.FontSource = HxFontSourceConstant.HxFontExternal;
HtmlHelp2Environment.FilterQueryChanged += new EventHandler(FilterQueryChanged);
HtmlHelp2Environment.NamespaceReloaded += new EventHandler(NamespaceReloaded);
}
catch {
this.FakeHelpControl();
}
}
else {
this.FakeHelpControl();
}
// Filter Combobox
Panel panel1 = new Panel();
Controls.Add(panel1);
panel1.Dock = DockStyle.Top;
panel1.Height = filterCombobox.Height + 7;
panel1.Controls.Add(filterCombobox);
filterCombobox.Dock = DockStyle.Top;
filterCombobox.DropDownStyle = ComboBoxStyle.DropDownList;
filterCombobox.Sorted = true;
filterCombobox.Enabled = Help2EnvIsReady;
filterCombobox.SelectedIndexChanged += new EventHandler(FilterChanged);
// Filter label
Controls.Add(label1);
label1.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.FilteredBy}");
label1.Dock = DockStyle.Top;
label1.TextAlign = ContentAlignment.MiddleLeft;
label1.Enabled = Help2EnvIsReady;
// SearchTerm Combobox
Panel panel2 = new Panel();
Controls.Add(panel2);
panel2.Dock = DockStyle.Top;
panel2.Height = searchTerm.Height + 7;
panel2.Controls.Add(searchTerm);
searchTerm.Dock = DockStyle.Top;
searchTerm.Enabled = Help2EnvIsReady;
searchTerm.TextChanged += new EventHandler(SearchTextChanged);
searchTerm.KeyPress += new KeyPressEventHandler(KeyPressed);
// SearchTerm Label
Controls.Add(label2);
label2.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.LookFor}");
label2.Dock = DockStyle.Top;
label2.TextAlign = ContentAlignment.MiddleLeft;
label2.Enabled = Help2EnvIsReady;
}
private void FakeHelpControl()
{
if(indexControl != null) indexControl.Dispose();
indexControl = null;
Controls.Clear();
Panel nohelpPanel = new Panel();
Controls.Add(nohelpPanel);
nohelpPanel.Dock = DockStyle.Fill;
nohelpPanel.BorderStyle = BorderStyle.Fixed3D;
}
public void LoadIndex()
{
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 {
}
}
private void FilterChanged(object sender, EventArgs e)
{
string selectedString = filterCombobox.SelectedItem.ToString();
if(selectedString != "") {
try {
Cursor.Current = Cursors.WaitCursor;
indexControl.IndexData = HtmlHelp2Environment.GetIndex(HtmlHelp2Environment.FindFilterQuery(selectedString));
Cursor.Current = Cursors.Default;
}
catch {
}
}
}
#region Help 2.0 Environment Events
private void FilterQueryChanged(object sender, EventArgs e)
{
indexControl.Refresh();
string currentFilterName = filterCombobox.SelectedItem.ToString();
if(String.Compare(currentFilterName, HtmlHelp2Environment.CurrentFilterName) != 0) {
filterCombobox.SelectedIndexChanged -= new EventHandler(FilterChanged);
filterCombobox.SelectedIndex = filterCombobox.Items.IndexOf(HtmlHelp2Environment.CurrentFilterName);
indexControl.IndexData = HtmlHelp2Environment.GetIndex(HtmlHelp2Environment.CurrentFilterQuery);
filterCombobox.SelectedIndexChanged += new EventHandler(FilterChanged);
}
}
private void NamespaceReloaded(object sender, EventArgs e)
{
this.LoadIndex();
}
#endregion
private void SearchTextChanged(object sender, EventArgs e)
{
if(!itemClicked && searchTerm.Text != "") {
indexControl.Selection = indexControl.IndexData.GetSlotFromString(searchTerm.Text);
}
}
private void KeyPressed(object sender, KeyPressEventArgs e)
{
if(e.KeyChar == (char)13) {
int indexSlot = indexControl.IndexData.GetSlotFromString(searchTerm.Text);
string indexTerm = indexControl.IndexData.GetFullStringFromSlot(indexSlot, ",");
searchTerm.Items.Insert(0,indexTerm);
searchTerm.SelectedIndex = 0;
if(searchTerm.Items.Count > 10) searchTerm.Items.RemoveAt(10);
this.ShowSelectedItemEntry(indexTerm, indexSlot);
}
}
private void IndexItemClicked(object sender, IHxIndexViewEvents_ItemClickEvent e)
{
string indexTerm = indexControl.IndexData.GetFullStringFromSlot(e.iItem, ",");
int indexSlot = e.iItem;
itemClicked = true;
searchTerm.Items.Insert(0,indexTerm);
searchTerm.SelectedIndex = 0;
itemClicked = false;
this.ShowSelectedItemEntry(indexTerm, indexSlot);
}
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();
for(int i = 1; i <= matchingTopics.Count; i++) {
IHxTopic topic = matchingTopics.ItemAt(i);
if(topic != null) {
ListViewItem lvi = new ListViewItem();
lvi.Text = topic.get_Title(HxTopicGetTitleType.HxTopicGetRLTitle,HxTopicGetTitleDefVal.HxTopicGetTitleFileName);
lvi.SubItems.Add(topic.Location);
lvi.Tag = topic;
((HtmlHelp2IndexResultsPad)indexResults.PadContent).IndexResultsListView.Items.Add(lvi);
}
}
}
finally {
((HtmlHelp2IndexResultsPad)indexResults.PadContent).IndexResultsListView.EndUpdate();
((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 {
}
}
}
}

148
src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/IndexResultsPad.cs

@ -0,0 +1,148 @@ @@ -0,0 +1,148 @@
/* ***********************************************************
*
* Help 2.0 Environment for SharpDevelop
* Index results Pad
* Copyright (c) 2005, Mathias Simmack. All rights reserved.
*
* ********************************************************* */
namespace HtmlHelp2
{
using System;
using System.Collections;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
using MSHelpServices;
using HtmlHelp2Browser;
using HtmlHelp2Service;
public class ShowIndexResultsMenuCommand : AbstractMenuCommand
{
public override void Run()
{
PadDescriptor indexResults = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2IndexResultsPad));
if(indexResults != null) indexResults.BringPadToFront();
}
}
public class HtmlHelp2IndexResultsPad : AbstractPadContent
{
ListView listView = new ListView();
ColumnHeader title = new ColumnHeader();
ColumnHeader location = new ColumnHeader();
public override Control Control
{
get {
return listView;
}
}
public override void RedrawContent()
{
this.SetListViewHeader();
}
public ListView IndexResultsListView
{
get {
return listView;
}
}
public HtmlHelp2IndexResultsPad()
{
this.SetListViewHeader();
listView.Columns.Add(title);
listView.Columns.Add(location);
listView.FullRowSelect = true;
listView.Alignment = ListViewAlignment.Left;
listView.View = View.Details;
listView.Dock = DockStyle.Fill;
listView.MultiSelect = false;
listView.HideSelection = false;
listView.Enabled = HtmlHelp2Environment.IsReady;
ListViewResize(this,null);
listView.Resize += new EventHandler(ListViewResize);
listView.DoubleClick += new EventHandler(ListViewDoubleClick);
listView.ColumnClick += new ColumnClickEventHandler(ColumnClick);
listView.CreateControl();
}
private void SetListViewHeader()
{
title.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.Title}");
location.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.Location}");
}
private void ListViewResize(object sender, EventArgs e)
{
int w = (listView.Width - 60) / 2;
title.Width = w;
location.Width = w;
}
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);
}
}
private void ColumnClick(object sender, ColumnClickEventArgs e)
{
listView.ListViewItemSorter = new ListViewItemComparer(e.Column);
listView.Sort();
}
public void CleanUp()
{
foreach(ListViewItem lvi in listView.Items) {
if(lvi.Tag != null) { lvi.Tag = null; }
}
listView.Items.Clear();
}
public void SetStatusMessage(string indexTerm)
{
/*
* @SharpDevelop developers: I would like to have the possibility to
* change the Pad's title. It works without, but it would look
* better if I could write what was searched and how many topics are
* matching.
*/
if(listView.Items.Count > 1) {
string text = StringParser.Parse("${res:AddIns.HtmlHelp2.ResultsOfIndexResults}",
new string[,]
{{"0", indexTerm},
{"1", listView.Items.Count.ToString()},
{"2", (listView.Items.Count == 1)?"${res:AddIns.HtmlHelp2.SingleTopic}":"${res:AddIns.HtmlHelp2.MultiTopic}"}}
);
StatusBarService.SetMessage(text);
}
}
#region Sorting
class ListViewItemComparer : IComparer
{
private int col;
public ListViewItemComparer(int column) {
col = column;
}
public int Compare(object x, object y) {
return String.Compare(((ListViewItem)x).SubItems[col].Text, ((ListViewItem)y).SubItems[col].Text);
}
}
#endregion
}
}

299
src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/SearchPad.cs

@ -0,0 +1,299 @@ @@ -0,0 +1,299 @@
/* ***********************************************************
*
* Help 2.0 Environment for SharpDevelop
* Search Pad
* Copyright (c) 2005, Mathias Simmack. All rights reserved.
*
* ********************************************************* */
namespace HtmlHelp2
{
using System;
using System.Drawing;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
using HtmlHelp2Service;
using HtmlHelp2HelperDialog;
using MSHelpServices;
public class ShowSearchMenuCommand : AbstractMenuCommand
{
public override void Run()
{
PadDescriptor search = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2SearchPad));
if(search != null) search.BringPadToFront();
}
}
public class HtmlHelp2SearchPad : AbstractPadContent
{
Panel mainPanel = new Panel();
Button searchButton = new Button();
ComboBox filterCombobox = new ComboBox();
ComboBox searchTerm = new ComboBox();
CheckBox titlesOnly = new CheckBox();
CheckBox enableStemming = new CheckBox();
CheckBox reuseMatches = new CheckBox();
CheckBox hiliteTopics = new CheckBox();
Label label1 = new Label();
Label label2 = new Label();
string selectedQuery = "";
bool searchIsBusy = false;
public override Control Control
{
get {
return mainPanel;
}
}
public override void RedrawContent()
{
searchButton.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.Search}");
titlesOnly.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.SearchInTitlesOnly}");
enableStemming.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.LookForSimilarWords}");
reuseMatches.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.SearchInPreviouslyFoundTopics}");
hiliteTopics.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.HighlightMatches}");
label1.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.FilteredBy}");
label2.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.LookFor}");
}
public bool HiliteEnabled
{
get {
return hiliteTopics.Checked;
}
}
public HtmlHelp2SearchPad()
{
this.InitializeComponents();
}
private void InitializeComponents()
{
// Search controls
Panel panel3 = new Panel();
mainPanel.Controls.Add(panel3);
panel3.Width = 500;
int pw = panel3.Width;
panel3.Controls.Add(searchButton);
searchButton.Enabled = false;
searchButton.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.Search}");
searchButton.Click += new EventHandler(SearchButtonClick);
panel3.Controls.Add(titlesOnly);
panel3.Controls.Add(enableStemming);
panel3.Controls.Add(reuseMatches);
panel3.Controls.Add(hiliteTopics);
titlesOnly.Width = pw;
titlesOnly.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.SearchInTitlesOnly}");
titlesOnly.Top = searchButton.Top + searchButton.Height + 10;
titlesOnly.TextAlign = ContentAlignment.MiddleLeft;
titlesOnly.Enabled = HtmlHelp2Environment.IsReady;
enableStemming.Width = pw;
enableStemming.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.LookForSimilarWords}");
enableStemming.Top = titlesOnly.Top + titlesOnly.Height - 4;
enableStemming.TextAlign = ContentAlignment.MiddleLeft;
enableStemming.Enabled = HtmlHelp2Environment.IsReady;
reuseMatches.Width = pw;
reuseMatches.Top = enableStemming.Top + enableStemming.Height - 4;
reuseMatches.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.SearchInPreviouslyFoundTopics}");
reuseMatches.Enabled = false;
reuseMatches.TextAlign = ContentAlignment.MiddleLeft;
hiliteTopics.Width = pw;
hiliteTopics.Top = reuseMatches.Top + reuseMatches.Height - 4;
hiliteTopics.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.HighlightMatches}");
hiliteTopics.TextAlign = ContentAlignment.MiddleLeft;
hiliteTopics.Enabled = HtmlHelp2Environment.IsReady;
panel3.Dock = DockStyle.Fill;
// Filter Combobox
Panel panel1 = new Panel();
mainPanel.Controls.Add(panel1);
panel1.Dock = DockStyle.Top;
panel1.Height = filterCombobox.Height + 15;
panel1.Controls.Add(filterCombobox);
filterCombobox.Dock = DockStyle.Top;
filterCombobox.DropDownStyle = ComboBoxStyle.DropDownList;
filterCombobox.Sorted = true;
filterCombobox.Enabled = HtmlHelp2Environment.IsReady;
filterCombobox.SelectedIndexChanged += new EventHandler(FilterChanged);
if(HtmlHelp2Environment.IsReady) {
HtmlHelp2Environment.BuildFilterList(filterCombobox);
HtmlHelp2Environment.FilterQueryChanged += new EventHandler(FilterQueryChanged);
HtmlHelp2Environment.NamespaceReloaded += new EventHandler(NamespaceReloaded);
}
// Filter label
mainPanel.Controls.Add(label1);
label1.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.FilteredBy}");
label1.Dock = DockStyle.Top;
label1.TextAlign = ContentAlignment.MiddleLeft;
label1.Enabled = HtmlHelp2Environment.IsReady;
// SearchTerm Combobox
Panel panel2 = new Panel();
mainPanel.Controls.Add(panel2);
panel2.Dock = DockStyle.Top;
panel2.Height = searchTerm.Height + 7;
panel2.Controls.Add(searchTerm);
searchTerm.Dock = DockStyle.Top;
searchTerm.TextChanged += new EventHandler(SearchTextChanged);
searchTerm.KeyPress += new KeyPressEventHandler(KeyPressed);
searchTerm.Enabled = HtmlHelp2Environment.IsReady;
mainPanel.Controls.Add(label2);
label2.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.LookFor}");
label2.Dock = DockStyle.Top;
label2.TextAlign = ContentAlignment.MiddleLeft;
label2.Enabled = HtmlHelp2Environment.IsReady;
}
private void FilterChanged(object sender, EventArgs e)
{
object selectedItem = filterCombobox.SelectedItem;
if(selectedItem != null) {
try {
selectedQuery = HtmlHelp2Environment.FindFilterQuery(selectedItem.ToString());
}
catch {
}
}
}
#region Help 2.0 Environment Events
private void FilterQueryChanged(object sender, EventArgs e)
{
mainPanel.Refresh();
string currentFilterName = filterCombobox.SelectedItem.ToString();
if(String.Compare(currentFilterName, HtmlHelp2Environment.CurrentFilterName) != 0) {
filterCombobox.SelectedIndexChanged -= new EventHandler(FilterChanged);
filterCombobox.SelectedIndex = filterCombobox.Items.IndexOf(HtmlHelp2Environment.CurrentFilterName);
selectedQuery = HtmlHelp2Environment.CurrentFilterQuery;
filterCombobox.SelectedIndexChanged += new EventHandler(FilterChanged);
}
}
private void NamespaceReloaded(object sender, EventArgs e)
{
try {
searchTerm.Text = "";
searchTerm.Items.Clear();
filterCombobox.SelectedIndexChanged -= new EventHandler(FilterChanged);
HtmlHelp2Environment.BuildFilterList(filterCombobox);
filterCombobox.SelectedIndexChanged += new EventHandler(FilterChanged);
}
catch {
}
}
#endregion
private void SearchButtonClick(object sender, EventArgs e)
{
if(searchTerm.Text != "") {
this.AddTermToList(searchTerm.Text);
this.PerformFTS(searchTerm.Text);
}
}
private void SearchTextChanged(object sender, EventArgs e)
{
searchButton.Enabled = (searchTerm.Text != "");
}
private void KeyPressed(object sender, KeyPressEventArgs e)
{
if(e.KeyChar == (char)13 && searchTerm.Text != null) {
this.AddTermToList(searchTerm.Text);
this.PerformFTS(searchTerm.Text);
}
}
private void AddTermToList(string searchText)
{
if(searchTerm.Items.IndexOf(searchText) == -1) {
searchTerm.Items.Insert(0, searchText);
if(searchTerm.Items.Count > 10) searchTerm.Items.RemoveAt(10);
searchTerm.SelectedIndex = 0;
}
}
#region FTS
private void PerformFTS(string searchWord)
{
if(!HtmlHelp2Environment.IsReady || searchIsBusy) {
return;
}
PadDescriptor searchResults = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2SearchResultsPad));
if(searchResults == null) {
return;
}
try {
searchIsBusy = true;
HxQuery_Options searchFlags = HxQuery_Options.HxQuery_No_Option;
searchFlags |= (titlesOnly.Checked)?HxQuery_Options.HxQuery_FullTextSearch_Title_Only:HxQuery_Options.HxQuery_No_Option;
searchFlags |= (enableStemming.Checked)?HxQuery_Options.HxQuery_FullTextSearch_Enable_Stemming:HxQuery_Options.HxQuery_No_Option;
searchFlags |= (reuseMatches.Checked)?HxQuery_Options.HxQuery_FullTextSearch_SearchPrevious:HxQuery_Options.HxQuery_No_Option;
HtmlHelp2Dialog searchDialog = new HtmlHelp2Dialog();
searchDialog.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.HelpSearchCaption}");
searchDialog.ActionLabel = StringParser.Parse("${res:AddIns.HtmlHelp2.HelpSearchInProgress}",
new string[,]
{{"0", searchWord}});
searchDialog.Show();
Application.DoEvents();
Cursor.Current = Cursors.WaitCursor;
IHxTopicList matchingTopics = HtmlHelp2Environment.FTS.Query(searchWord, searchFlags);
Cursor.Current = Cursors.Default;
searchDialog.Dispose();
try {
((HtmlHelp2SearchResultsPad)searchResults.PadContent).CleanUp();
((HtmlHelp2SearchResultsPad)searchResults.PadContent).SearchResultsListView.BeginUpdate();
for(int i = 1; i <= matchingTopics.Count; i++) {
IHxTopic topic = matchingTopics.ItemAt(i);
if(topic != null) {
ListViewItem lvi = new ListViewItem();
lvi.Text = topic.get_Title(HxTopicGetTitleType.HxTopicGetRLTitle,HxTopicGetTitleDefVal.HxTopicGetTitleFileName);
lvi.SubItems.Add(topic.Location);
lvi.SubItems.Add(topic.Rank.ToString());
lvi.Tag = topic;
((HtmlHelp2SearchResultsPad)searchResults.PadContent).SearchResultsListView.Items.Add(lvi);
}
}
reuseMatches.Enabled = true;
}
finally {
((HtmlHelp2SearchResultsPad)searchResults.PadContent).SearchResultsListView.EndUpdate();
((HtmlHelp2SearchResultsPad)searchResults.PadContent).SetStatusMessage(searchTerm.Text);
searchResults.BringPadToFront();
searchIsBusy = false;
}
}
catch {
}
}
#endregion
}
}

161
src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/SearchResultsPad.cs

@ -0,0 +1,161 @@ @@ -0,0 +1,161 @@
/* ***********************************************************
*
* Help 2.0 Environment for SharpDevelop
* Search results Pad
* Copyright (c) 2005, Mathias Simmack. All rights reserved.
*
* ********************************************************* */
namespace HtmlHelp2
{
using System;
using System.Collections;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
using MSHelpServices;
using HtmlHelp2Browser;
using HtmlHelp2Service;
public class ShowSearchResultsMenuCommand : AbstractMenuCommand
{
public override void Run()
{
PadDescriptor searchResults = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2SearchResultsPad));
if(searchResults != null) searchResults.BringPadToFront();
}
}
public class HtmlHelp2SearchResultsPad : AbstractPadContent
{
ListView listView = new ListView();
ColumnHeader title = new ColumnHeader();
ColumnHeader location = new ColumnHeader();
ColumnHeader rank = new ColumnHeader();
public override Control Control
{
get {
return listView;
}
}
public override void RedrawContent()
{
this.SetListViewHeader();
}
public ListView SearchResultsListView
{
get {
return listView;
}
}
public HtmlHelp2SearchResultsPad()
{
this.SetListViewHeader();
listView.Columns.Add(title);
listView.Columns.Add(location);
listView.Columns.Add(rank);
listView.FullRowSelect = true;
listView.AutoArrange = true;
listView.Enabled = HtmlHelp2Environment.IsReady;
listView.Alignment = ListViewAlignment.Left;
listView.View = View.Details;
listView.Dock = DockStyle.Fill;
ListViewResize(this,null);
listView.Resize += new EventHandler(ListViewResize);
listView.DoubleClick += new EventHandler(ListViewDoubleClick);
listView.ColumnClick += new ColumnClickEventHandler(ColumnClick);
listView.CreateControl();
}
private void SetListViewHeader()
{
title.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.Title}");
location.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.Location}");
rank.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.Rank}");
}
private void ListViewResize(object sender, EventArgs e)
{
rank.Width = 80;
int w = (listView.Width - rank.Width - 40) / 2;
title.Width = w;
location.Width = w;
}
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 ColumnClick(object sender, ColumnClickEventArgs e)
{
listView.ListViewItemSorter = new ListViewItemComparer(e.Column);
listView.Sort();
}
public void CleanUp()
{
foreach(ListViewItem lvi in listView.Items) {
if(lvi.Tag != null) { lvi.Tag = null; }
}
listView.Items.Clear();
}
public void SetStatusMessage(string indexTerm)
{
/*
* @SharpDevelop developers: I would like to have the possibility to
* change the Pad's title. It works without, but it would look
* better if I could write what was searched and how many topics are
* matching.
*/
string text = StringParser.Parse("${res:AddIns.HtmlHelp2.ResultsOfSearchResults}",
new string[,]
{{"0", indexTerm},
{"1", listView.Items.Count.ToString()},
{"2", (listView.Items.Count == 1)?"${res:AddIns.HtmlHelp2.SingleTopic}":"${res:AddIns.HtmlHelp2.MultiTopic}"}}
);
StatusBarService.SetMessage(text);
}
#region Sorting
class ListViewItemComparer : IComparer
{
private int col;
public ListViewItemComparer(int column) {
col = column;
}
public int Compare(object x, object y) {
switch(col) {
case 2:
int a = Int32.Parse(((ListViewItem)x).SubItems[col].Text);
int b = Int32.Parse(((ListViewItem)y).SubItems[col].Text);
if(a > b) return 1;
else if(a < b) return -1;
else return 0;
default:
return String.Compare(((ListViewItem)x).SubItems[col].Text, ((ListViewItem)y).SubItems[col].Text);
}
}
}
#endregion
}
}

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

@ -0,0 +1,357 @@ @@ -0,0 +1,357 @@
/* ***********************************************************
*
* Help 2.0 Environment for SharpDevelop
* Table of Contents Pad
* Copyright (c) 2005, Mathias Simmack. All rights reserved.
*
* ********************************************************* */
//#define DExplore8Style_NoTOCPictures
namespace HtmlHelp2
{
using System;
using System.Drawing;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
using AxMSHelpControls;
using MSHelpControls;
using MSHelpServices;
using HtmlHelp2Service;
using HtmlHelp2Browser;
public class ShowTocMenuCommand : AbstractMenuCommand
{
public override void Run()
{
PadDescriptor toc = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2TocPad));
if(toc != null) toc.BringPadToFront();
}
}
public class HtmlHelp2TocPad : AbstractPadContent
{
protected MsHelp2TocControl help2TocControl;
public override Control Control
{
get {
return help2TocControl;
}
}
public override void Dispose()
{
try {
help2TocControl.Dispose();
}
catch {
}
}
public override void RedrawContent()
{
help2TocControl.RedrawContent();
}
public HtmlHelp2TocPad()
{
help2TocControl = new MsHelp2TocControl();
help2TocControl.LoadToc();
}
public void SyncToc(string topicUrl)
{
try {
help2TocControl.SynToc(topicUrl);
}
catch {
}
}
public void GetPrevFromNode()
{
try {
help2TocControl.GetPrevFromNode();
}
catch {
}
}
public void GetNextFromNode()
{
try {
help2TocControl.GetNextFromNode();
}
catch {
}
}
public bool IsNotFirstNode
{
get {
return help2TocControl.IsNotFirstNode;
}
}
public bool IsNotLastNode
{
get {
return help2TocControl.IsNotLastNode;
}
}
}
public class MsHelp2TocControl : UserControl
{
AxHxTocCtrl tocControl = null;
ComboBox filterCombobox = new ComboBox();
Label label1 = new Label();
ContextMenuStrip printPopup = new ContextMenuStrip();
ToolStripMenuItem printTopic = new ToolStripMenuItem();
ToolStripMenuItem printChildTopics = new ToolStripMenuItem();
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if(disposing && tocControl != null) {
tocControl.Dispose();
}
}
public void RedrawContent()
{
label1.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.FilteredBy}");
}
public MsHelp2TocControl()
{
bool Help2EnvIsReady = (HtmlHelp2Environment.IsReady && Help2ControlsValidation.IsTocControlRegistered);
if(Help2EnvIsReady) {
try {
tocControl = new AxHxTocCtrl();
tocControl.BeginInit();
tocControl.Dock = DockStyle.Fill;
tocControl.NodeClick += new AxMSHelpControls.IHxTreeViewEvents_NodeClickEventHandler(this.TocNodeClicked);
tocControl.NodeRightClick += new AxMSHelpControls.IHxTreeViewEvents_NodeRightClickEventHandler(this.TocNodeRightClicked);
tocControl.EndInit();
Controls.Add(tocControl);
tocControl.CreateControl();
tocControl.BorderStyle = HxBorderStyle.HxBorderStyle_FixedSingle;
tocControl.FontSource = HxFontSourceConstant.HxFontExternal;
#if DExplore8Style_NoTOCPictures
tocControl.TreeStyle = HxTreeStyleConstant.HxTreeStyle_TreelinesPlusMinusText;
#endif
printTopic.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.PrintTopic}");
printChildTopics.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.PrintSubtopics}");
printPopup.Items.Add(printTopic);
printTopic.Click += new EventHandler(this.PrintTopic);
printPopup.Items.Add(printChildTopics);
printChildTopics.Click += new EventHandler(this.PrintTopicAndSubtopics);
}
catch {
this.FakeHelpControl();
}
}
else {
this.FakeHelpControl();
}
// Combobox panel
Panel panel1 = new Panel();
Controls.Add(panel1);
panel1.Dock = DockStyle.Top;
panel1.Height = filterCombobox.Height + 7;
panel1.Controls.Add(filterCombobox);
filterCombobox.Dock = DockStyle.Top;
filterCombobox.DropDownStyle = ComboBoxStyle.DropDownList;
filterCombobox.Sorted = true;
filterCombobox.Enabled = Help2EnvIsReady;
filterCombobox.SelectedIndexChanged += new EventHandler(this.FilterChanged);
// Filter label
Controls.Add(label1);
label1.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.FilteredBy}");
label1.Dock = DockStyle.Top;
label1.TextAlign = ContentAlignment.MiddleLeft;
label1.Enabled = Help2EnvIsReady;
if(Help2EnvIsReady) {
HtmlHelp2Environment.FilterQueryChanged += new EventHandler(this.FilterQueryChanged);
HtmlHelp2Environment.NamespaceReloaded += new EventHandler(this.NamespaceReloaded);
}
}
private void FakeHelpControl()
{
tocControl = null;
Panel nohelpPanel = new Panel();
Controls.Add(nohelpPanel);
nohelpPanel.Dock = DockStyle.Fill;
nohelpPanel.BorderStyle = BorderStyle.Fixed3D;
}
public void LoadToc()
{
try {
tocControl.Hierarchy = HtmlHelp2Environment.GetTocHierarchy(HtmlHelp2Environment.CurrentFilterQuery);
filterCombobox.SelectedIndexChanged -= new EventHandler(this.FilterChanged);
HtmlHelp2Environment.BuildFilterList(filterCombobox);
filterCombobox.SelectedIndexChanged += new EventHandler(this.FilterChanged);
}
catch {
}
}
private void FilterChanged(object sender, EventArgs e)
{
string selectedString = filterCombobox.SelectedItem.ToString();
if(selectedString != null && selectedString != "") {
try {
Cursor.Current = Cursors.WaitCursor;
tocControl.Hierarchy = HtmlHelp2Environment.GetTocHierarchy(HtmlHelp2Environment.FindFilterQuery(selectedString));
Cursor.Current = Cursors.Default;
}
catch {
}
}
}
#region Help 2.0 Environment Events
private void FilterQueryChanged(object sender, EventArgs e)
{
tocControl.Refresh();
string currentFilterName = filterCombobox.SelectedItem.ToString();
if(String.Compare(currentFilterName, HtmlHelp2Environment.CurrentFilterName) != 0) {
filterCombobox.SelectedIndexChanged -= new EventHandler(this.FilterChanged);
filterCombobox.SelectedIndex = filterCombobox.Items.IndexOf(HtmlHelp2Environment.CurrentFilterName);
tocControl.Hierarchy = HtmlHelp2Environment.GetTocHierarchy(HtmlHelp2Environment.CurrentFilterQuery);
filterCombobox.SelectedIndexChanged += new EventHandler(this.FilterChanged);
}
}
private void NamespaceReloaded(object sender, EventArgs e)
{
this.LoadToc();
}
#endregion
private void CallHelp(string topicUrl, bool syncToc)
{
if(topicUrl != null && topicUrl != "") {
if(syncToc) this.SynToc(topicUrl);
ShowHelpBrowser.OpenHelpView(topicUrl);
}
}
private void TocNodeClicked(object sender, IHxTreeViewEvents_NodeClickEvent e)
{
string TopicUrl = tocControl.Hierarchy.GetURL(e.hNode);
this.CallHelp(TopicUrl,false);
}
#region Printing
private void TocNodeRightClicked(object sender, IHxTreeViewEvents_NodeRightClickEvent e)
{
if(e.hNode != 0) {
printTopic.Enabled = tocControl.Hierarchy.GetURL(e.hNode) != "";
printChildTopics.Enabled = tocControl.Hierarchy.GetFirstChild(e.hNode) != 0;
printChildTopics.Text = StringParser.Parse((tocControl.Hierarchy.GetFirstChild(e.hNode) == 0 || tocControl.Hierarchy.GetURL(e.hNode) == "")?
"${res:AddIns.HtmlHelp2.PrintSubtopics}":
"${res:AddIns.HtmlHelp2.PrintTopicAndSubtopics}");
Point p = new Point(e.x, e.y);
p = this.PointToClient(p);
printPopup.Show(this, p);
}
}
private void PrintTopic(object sender, EventArgs e)
{
if(tocControl.Selection != 0) {
tocControl.Hierarchy.PrintNode(0,
tocControl.Selection,
HxHierarchy_PrintNode_Options.HxHierarchy_PrintNode_Option_Node);
}
}
private void PrintTopicAndSubtopics(object sender, EventArgs e)
{
if(tocControl.Selection != 0) {
tocControl.Hierarchy.PrintNode(0,
tocControl.Selection,
HxHierarchy_PrintNode_Options.HxHierarchy_PrintNode_Option_Children);
}
}
#endregion
#region published Help2 TOC Commands
public void SynToc(string topicUrl)
{
try {
tocControl.Synchronize(topicUrl);
}
catch {
}
}
public void GetNextFromNode()
{
try {
int currentNode = tocControl.Hierarchy.GetNextFromNode(tocControl.Selection);
string TopicUrl = tocControl.Hierarchy.GetURL(currentNode);
this.CallHelp(TopicUrl,true);
}
catch {
}
}
public void GetPrevFromNode()
{
try {
int currentNode = tocControl.Hierarchy.GetPrevFromNode(tocControl.Selection);
string TopicUrl = tocControl.Hierarchy.GetURL(currentNode);
this.CallHelp(TopicUrl,true);
}
catch {
}
}
public bool IsNotFirstNode
{
get {
try {
int currentNode = tocControl.Hierarchy.GetPrevFromNode(tocControl.Selection);
return currentNode != 0;
}
catch {
return true;
}
}
}
public bool IsNotLastNode
{
get {
try {
int currentNode = tocControl.Hierarchy.GetNextFromNode(tocControl.Selection);
return currentNode != 0;
}
catch {
return true;
}
}
}
#endregion
}
}

376
src/AddIns/Misc/HtmlHelp2/Project/src/BrowserControl/Browser.cs

@ -0,0 +1,376 @@ @@ -0,0 +1,376 @@
/* ***********************************************************
*
* Help 2.0 Environment for SharpDevelop
* Browser Control
* Based on "HtmlViewPane.cs" by Mike Krueger
*
* ********************************************************* */
//#define ChangeTopics_BringPadToFront
namespace HtmlHelp2Browser
{
using System;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.BrowserDisplayBinding;
using HtmlHelp2;
using HtmlHelp2Service;
public class HtmlHelp2BrowserPane : AbstractViewContent
{
protected HtmlHelp2BrowserControl help2Browser;
public override Control Control {
get {
return help2Browser;
}
}
public override bool IsDirty {
get {
return false;
}
set {
}
}
public override bool IsViewOnly {
get {
return true;
}
}
public HtmlHelp2BrowserPane(string fileName)
{
help2Browser = new HtmlHelp2BrowserControl();
help2Browser.AxWebBrowser.DocumentTitleChanged += new EventHandler(TitleChanged);
if(fileName != null) this.Load(fileName);
else this.Load("about:blank");
}
public override void Load(string url)
{
help2Browser.Navigate(url);
this.FileName = url;
}
public override void Save(string url)
{
Load(url);
}
void TitleChanged(object sender, EventArgs e)
{
this.TitleName = help2Browser.AxWebBrowser.DocumentTitle;
this.FileName = help2Browser.AxWebBrowser.Url.ToString();
}
}
public class HtmlHelp2BrowserControl : UserControl
{
ExtendedWebBrowser axWebBrowser = null;
ToolStripButton goBack = new ToolStripButton();
ToolStripButton goForward = new ToolStripButton();
ToolStripButton stopSite = new ToolStripButton();
ToolStripButton refreshSite = new ToolStripButton();
ToolStripButton homePage = new ToolStripButton();
ToolStripButton searchPage = new ToolStripButton();
ToolStripButton addToFavorites = new ToolStripButton();
ToolStripComboBox urlTextbox = new ToolStripComboBox();
ToolStripButton newWindow = new ToolStripButton();
ToolStripButton syncToc = new ToolStripButton();
ToolStripButton prevTocTopic = new ToolStripButton();
ToolStripButton nextTocTopic = new ToolStripButton();
// int zoomFactor = 2;
public WebBrowser AxWebBrowser
{
get {
return axWebBrowser;
}
}
public HtmlHelp2BrowserControl()
{
Size = new Size(800, 800);
Dock = DockStyle.Fill;
axWebBrowser = new ExtendedWebBrowser();
axWebBrowser.Dock = DockStyle.Fill;
axWebBrowser.StatusTextChanged += new EventHandler(this.StatusTextChanged);
axWebBrowser.Navigating += new WebBrowserNavigatingEventHandler(this.BeforeNavigating);
axWebBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(this.DocumentCompleted);
axWebBrowser.NewWindowExtended += new NewWindowExtendedEventHandler(this.NewBrowserWindow);
Controls.Add(axWebBrowser);
ToolStrip toolStrip = new ToolStrip();
toolStrip.Dock = DockStyle.Top;
toolStrip.AllowItemReorder = false;
Controls.Add(toolStrip);
toolStrip.Items.Add(goBack);
goBack.Click += new EventHandler(this.GoBack);
goBack.Enabled = false;
goBack.ImageIndex = 0;
toolStrip.Items.Add(goForward);
goForward.Click += new EventHandler(this.GoForward);
goForward.Enabled = false;
goForward.ImageIndex = 1;
toolStrip.Items.Add(stopSite);
stopSite.Click += new EventHandler(this.StopPageLoading);
stopSite.Enabled = false;
stopSite.ImageIndex = 2;
toolStrip.Items.Add(refreshSite);
refreshSite.Click += new EventHandler(this.RefreshPage);
refreshSite.ImageIndex = 3;
toolStrip.Items.Add(homePage);
homePage.Click += new EventHandler(this.CallHomepage);
homePage.ImageIndex = 4;
toolStrip.Items.Add(new ToolStripSeparator());
toolStrip.Items.Add(searchPage);
searchPage.Click += new EventHandler(this.CallSearchpage);
searchPage.ImageIndex = 5;
toolStrip.Items.Add(addToFavorites);
addToFavorites.Click += new EventHandler(this.AddToHelpFavorites);
addToFavorites.Enabled = false;
addToFavorites.ImageIndex = 6;
toolStrip.Items.Add(new ToolStripSeparator());
toolStrip.Items.Add(urlTextbox);
urlTextbox.AutoCompleteMode = AutoCompleteMode.Suggest;
urlTextbox.AutoCompleteSource = AutoCompleteSource.HistoryList;
urlTextbox.DropDownWidth = 300;
urlTextbox.Size = new Size(300, toolStrip.Items[0].Height);
urlTextbox.KeyDown += new KeyEventHandler(this.UrlTextboxKeyDown);
urlTextbox.SelectedIndexChanged += new EventHandler(this.UrlTextboxSelectedIndexChanged);
toolStrip.Items.Add(new ToolStripSeparator());
toolStrip.Items.Add(newWindow);
newWindow.Click += new EventHandler(this.NewHelpWindow);
newWindow.ImageIndex = 7;
toolStrip.Items.Add(syncToc);
syncToc.Click += new EventHandler(this.SyncToc);
syncToc.Enabled = false;
syncToc.ImageIndex = 8;
toolStrip.Items.Add(new ToolStripSeparator());
toolStrip.Items.Add(prevTocTopic);
prevTocTopic.Click += new EventHandler(this.PreviousTocTopic);
prevTocTopic.Enabled = false;
prevTocTopic.ImageIndex = 9;
toolStrip.Items.Add(nextTocTopic);
nextTocTopic.Click += new EventHandler(this.NextTocTopic);
nextTocTopic.Enabled = false;
nextTocTopic.ImageIndex = 10;
// TODO: name those buttons :o)
toolStrip.ImageList = new ImageList();
toolStrip.ImageList.Images.Add(ResourcesHelper.GetBitmap("HtmlHelp2.16x16.Back.png"));
toolStrip.ImageList.Images.Add(ResourcesHelper.GetBitmap("HtmlHelp2.16x16.Forward.png"));
toolStrip.ImageList.Images.Add(ResourcesHelper.GetBitmap("HtmlHelp2.16x16.Stop.png"));
toolStrip.ImageList.Images.Add(ResourcesHelper.GetBitmap("HtmlHelp2.16x16.Refresh.png"));
toolStrip.ImageList.Images.Add(ResourcesHelper.GetBitmap("HtmlHelp2.16x16.Home.gif"));
toolStrip.ImageList.Images.Add(ResourcesHelper.GetBitmap("HtmlHelp2.16x16.SearchSite.gif"));
toolStrip.ImageList.Images.Add(ResourcesHelper.GetBitmap("HtmlHelp2.16x16.AddToFavorites.png"));
toolStrip.ImageList.Images.Add(ResourcesHelper.GetBitmap("HtmlHelp2.16x16.NewWindow.png"));
toolStrip.ImageList.Images.Add(ResourcesHelper.GetBitmap("HtmlHelp2.16x16.SyncToc.png"));
toolStrip.ImageList.Images.Add(ResourcesHelper.GetBitmap("HtmlHelp2.16x16.PrevTopic.png"));
toolStrip.ImageList.Images.Add(ResourcesHelper.GetBitmap("HtmlHelp2.16x16.NextTopic.png"));
}
#region WebBrowser Events
private void StatusTextChanged(object sender, EventArgs e)
{
StatusBarService.SetMessage(axWebBrowser.StatusText);
}
private void BeforeNavigating(object sender, WebBrowserNavigatingEventArgs e)
{
stopSite.Enabled = true;
}
private void DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
// try {
// object arg = System.Reflection.Missing.Value;
// object dummy = 0;
//
// axWebBrowser.ExecWB(SHDocVw.OLECMDID.OLECMDID_ZOOM,
// SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER,
// ref arg,
// ref dummy);
//
// zoomFactor = (int)dummy;
// }
// catch {
// }
PadDescriptor toc = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2TocPad));
// update URL textbox
string currentUrl = e.Url.ToString();
urlTextbox.Text = currentUrl;
// update toolbar
goBack.Enabled = axWebBrowser.CanGoBack;
goForward.Enabled = axWebBrowser.CanGoForward;
stopSite.Enabled = false;
addToFavorites.Enabled = currentUrl.StartsWith("ms-help://");
syncToc.Enabled = addToFavorites.Enabled;
prevTocTopic.Enabled = (toc == null || ((HtmlHelp2TocPad)toc.PadContent).IsNotFirstNode);
nextTocTopic.Enabled = (toc == null || ((HtmlHelp2TocPad)toc.PadContent).IsNotLastNode);
// hilite (full-text search only!)
ShowHelpBrowser.HighlightDocument();
}
private void NewBrowserWindow(object sender, NewWindowExtendedEventArgs e)
{
HtmlHelp2BrowserPane help2Browser = new HtmlHelp2BrowserPane("");
WorkbenchSingleton.Workbench.ShowView(help2Browser);
help2Browser.WorkbenchWindow.SelectWindow();
ExtendedWebBrowser newBrowser = (ExtendedWebBrowser)((HtmlHelp2BrowserControl)help2Browser.Control).AxWebBrowser;
newBrowser.Navigate(e.Url);
e.Cancel = true;
}
#endregion
#region Toolbar Command
public void Navigate(string url)
{
this.AddTermToList(url);
axWebBrowser.Navigate(url);
}
private void GoBack(object sender, EventArgs e)
{
if(axWebBrowser.CanGoBack) axWebBrowser.GoBack();
}
private void GoForward(object sender, EventArgs e)
{
if(axWebBrowser.CanGoForward) axWebBrowser.GoForward();
}
private void StopPageLoading(object sender, EventArgs e)
{
axWebBrowser.Stop();
}
private void RefreshPage(object sender, EventArgs e)
{
axWebBrowser.Refresh();
}
private void CallHomepage(object sender, EventArgs e)
{
this.Navigate(HtmlHelp2Environment.DefaultPage);
}
private void CallSearchpage(object sender, EventArgs e)
{
this.Navigate(HtmlHelp2Environment.SearchPage);
}
private void AddToHelpFavorites(object sender, EventArgs e)
{
PadDescriptor favorites = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2FavoritesPad));
if(favorites != null) {
((HtmlHelp2FavoritesPad)favorites.PadContent).AddToFavorites(axWebBrowser.DocumentTitle, axWebBrowser.Url.ToString());
}
}
private void NewHelpWindow(object sender, EventArgs e)
{
if(axWebBrowser.Url != null) {
HtmlHelp2BrowserPane newPage = ShowHelpBrowser.CreateNewHelp2BrowserView();
newPage.Load(axWebBrowser.Url.ToString());
}
}
private void SyncToc(object sender, EventArgs e)
{
if(axWebBrowser.Url != null) {
PadDescriptor toc = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2TocPad));
if(toc != null) {
((HtmlHelp2TocPad)toc.PadContent).SyncToc(axWebBrowser.Url.ToString());
toc.BringPadToFront();
}
}
}
private void PreviousTocTopic(object sender, EventArgs e)
{
PadDescriptor toc = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2TocPad));
if(toc != null) {
((HtmlHelp2TocPad)toc.PadContent).GetPrevFromNode();
#if ChangeTopics_BringPadToFront
((HtmlHelp2TocPad)toc.PadContent).BringPadToFront();
#endif
}
}
private void NextTocTopic(object sender, EventArgs e)
{
PadDescriptor toc = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2TocPad));
if(toc != null) {
((HtmlHelp2TocPad)toc.PadContent).GetNextFromNode();
#if ChangeTopics_BringPadToFront
((HtmlHelp2TocPad)toc.PadContent).BringPadToFront();
#endif
}
}
// public void ZoomText()
// {
//// try {
//// zoomFactor = (zoomFactor == 4)?0:zoomFactor+1;
//// object zoomArg = zoomFactor;
//// object dummy = System.Reflection.Missing.Value;
////
//// axWebBrowser.ExecWB(SHDocVw.OLECMDID.OLECMDID_ZOOM,
//// SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER,
//// ref zoomArg,
//// ref dummy);
//// }
//// catch {
//// }
// }
#endregion
#region UrlTextbox
private void UrlTextboxKeyDown(object sender, KeyEventArgs e)
{
if(e.KeyCode == Keys.Enter && urlTextbox.Text != "") {
this.AddTermToList(urlTextbox.Text);
this.Navigate(urlTextbox.Text);
}
}
private void UrlTextboxSelectedIndexChanged(object sender, EventArgs e)
{
string selectedUrl = urlTextbox.SelectedItem.ToString();
if(selectedUrl != "") {
this.Navigate(selectedUrl);
}
}
private void AddTermToList(string searchText)
{
if(searchText == "") return;
if(urlTextbox.Items.IndexOf(searchText) == -1) {
urlTextbox.Items.Insert(0, searchText);
if(urlTextbox.Items.Count > 10) urlTextbox.Items.RemoveAt(10);
urlTextbox.SelectedIndex = 0;
}
}
#endregion
}
}

98
src/AddIns/Misc/HtmlHelp2/Project/src/BrowserControl/ShowHelpBrowser.cs

@ -0,0 +1,98 @@ @@ -0,0 +1,98 @@
/* ***********************************************************
*
* Help 2.0 Environment for SharpDevelop
* ShowHelpBrowser Class
* Copyright (c) 2005, Mathias Simmack. All rights reserved.
*
* With a big "Thank you" to Robert_G (Delphi-PRAXiS)
*
* ********************************************************* */
namespace HtmlHelp2
{
using System;
using ICSharpCode.SharpDevelop.Gui;
using MSHelpServices;
using HtmlHelp2Browser;
public sealed class ShowHelpBrowser
{
static bool hiliteMatches = false;
static IHxTopic lastTopic = null;
public static void OpenHelpView(IHxTopic topic)
{
OpenHelpView(topic.URL, null, false);
}
public static void OpenHelpView(IHxTopic topic, bool hiliteMatchingWords)
{
OpenHelpView(topic.URL, topic, hiliteMatchingWords);
}
public static void OpenHelpView(string topicUrl)
{
OpenHelpView(topicUrl, null, false);
}
public static void OpenHelpView(string topicUrl, IHxTopic topic, bool hiliteMatchingWords)
{
hiliteMatches = hiliteMatchingWords;
lastTopic = topic;
HtmlHelp2BrowserPane help2Browser = GetActiveHelp2BrowserView();
if(help2Browser != null) {
help2Browser.Load(topicUrl);
help2Browser.WorkbenchWindow.SelectWindow();
}
}
public static HtmlHelp2BrowserPane GetActiveHelp2BrowserView()
{
HtmlHelp2BrowserPane tempPane = null;
IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;
if(window != null && window.ActiveViewContent is HtmlHelp2BrowserPane) {
tempPane = (HtmlHelp2BrowserPane)window.ActiveViewContent;
return tempPane;
}
foreach(IViewContent view in WorkbenchSingleton.Workbench.ViewContentCollection) {
if(view is HtmlHelp2BrowserPane) {
tempPane = (HtmlHelp2BrowserPane)view;
return tempPane;
}
}
tempPane = CreateNewHelp2BrowserView();
return tempPane;
}
public static HtmlHelp2BrowserPane CreateNewHelp2BrowserView()
{
HtmlHelp2BrowserPane tempPane = new HtmlHelp2BrowserPane("");
WorkbenchSingleton.Workbench.ShowView(tempPane);
return tempPane;
}
public static void HighlightDocument()
{
if(hiliteMatches && lastTopic != null) {
try {
IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;
if(window != null && window.ActiveViewContent is HtmlHelp2BrowserPane) {
HtmlHelp2BrowserPane help2Browser = (HtmlHelp2BrowserPane)window.ActiveViewContent;
HtmlHelp2BrowserControl browserControl = (HtmlHelp2BrowserControl)help2Browser.Control;
lastTopic.HighlightDocument(browserControl.AxWebBrowser.Document);
}
}
catch {
}
}
}
ShowHelpBrowser()
{
}
}
}

764
src/AddIns/Misc/HtmlHelp2/Project/src/Service/AxMSHelpControls.cs

@ -0,0 +1,764 @@ @@ -0,0 +1,764 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50215.44
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AxMSHelpControls
{
[System.Windows.Forms.AxHost.ClsidAttribute("{314111b8-a502-11d2-bbca-00c04f8ec294}")]
[System.ComponentModel.DesignTimeVisibleAttribute(true)]
public class AxHxTocCtrl : System.Windows.Forms.AxHost {
private MSHelpControls.IHxTreeView ocx;
private AxHxTocCtrlEventMulticaster eventMulticaster;
private System.Windows.Forms.AxHost.ConnectionPointCookie cookie;
public AxHxTocCtrl() : base("314111b8-a502-11d2-bbca-00c04f8ec294")
{
}
[System.ComponentModel.Browsable(false)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(4096)]
public virtual MSHelpServices.IHxHierarchy Hierarchy {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Hierarchy", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.Hierarchy;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Hierarchy", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.Hierarchy = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(4100)]
public virtual int ImageList {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("ImageList", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.ImageList;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("ImageList", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.ImageList = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(4097)]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public virtual bool HideSelection {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("HideSelection", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.HideSelection;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("HideSelection", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.HideSelection = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(4098)]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public virtual MSHelpControls.HxTreeLineStyleConstant LineStyle {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("LineStyle", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.LineStyle;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("LineStyle", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.LineStyle = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(4099)]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public virtual MSHelpControls.HxTreeStyleConstant TreeStyle {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("TreeStyle", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.TreeStyle;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("TreeStyle", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.TreeStyle = value;
}
}
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-501)]
[System.Runtime.InteropServices.ComAliasNameAttribute("System.UInt32")]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public override System.Drawing.Color BackColor {
get {
if (((this.ocx != null)
&& (this.PropsValid() == true))) {
return GetColorFromOleColor(((uint)(this.ocx.BackColor)));
}
else {
return base.BackColor;
}
}
set {
base.BackColor = value;
if ((this.ocx != null)) {
this.ocx.BackColor = ((uint)(GetOleColorFromColor(value)));
}
}
}
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-513)]
[System.Runtime.InteropServices.ComAliasNameAttribute("System.UInt32")]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public override System.Drawing.Color ForeColor {
get {
if (((this.ocx != null)
&& (this.PropsValid() == true))) {
return GetColorFromOleColor(((uint)(this.ocx.ForeColor)));
}
else {
return base.ForeColor;
}
}
set {
base.ForeColor = value;
if ((this.ocx != null)) {
this.ocx.ForeColor = ((uint)(GetOleColorFromColor(value)));
}
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-504)]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public virtual MSHelpControls.HxBorderStyle BorderStyle {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("BorderStyle", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.BorderStyle;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("BorderStyle", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.BorderStyle = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-520)]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public virtual MSHelpControls.HxAppearanceConstant Appearance {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Appearance", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.Appearance;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Appearance", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.Appearance = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-521)]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public virtual MSHelpControls.HxMousePointerConstant MousePointer {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("MousePointer", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.MousePointer;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("MousePointer", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.MousePointer = value;
}
}
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-512)]
[System.Runtime.InteropServices.ComAliasNameAttribute("stdole.StdFont")]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public override System.Drawing.Font Font {
get {
if (((this.ocx != null)
&& (this.PropsValid() == true))) {
return GetFontFromIFont(this.ocx.Font);
}
else {
return base.Font;
}
}
set {
base.Font = value;
if ((this.ocx != null)) {
this.ocx.Font = ((stdole.StdFont)(GetIFontFromFont(value)));
}
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(4102)]
public virtual int Selection {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Selection", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.Selection;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(4103)]
public virtual short LangId {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("LangId", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.LangId;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("LangId", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.LangId = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(4104)]
public virtual MSHelpControls.HxFontSourceConstant FontSource {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("FontSource", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.FontSource;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("FontSource", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.FontSource = value;
}
}
public event IHxTreeViewEvents_NodeClickEventHandler NodeClick;
public event IHxTreeViewEvents_NodeRightClickEventHandler NodeRightClick;
public override void Refresh() {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Refresh", System.Windows.Forms.AxHost.ActiveXInvokeKind.MethodInvoke);
}
this.ocx.Refresh();
}
public virtual void Synchronize(string bstrURL) {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Synchronize", System.Windows.Forms.AxHost.ActiveXInvokeKind.MethodInvoke);
}
this.ocx.Synchronize(bstrURL);
}
protected override void CreateSink() {
try {
this.eventMulticaster = new AxHxTocCtrlEventMulticaster(this);
this.cookie = new System.Windows.Forms.AxHost.ConnectionPointCookie(this.ocx, this.eventMulticaster, typeof(MSHelpControls.IHxTreeViewEvents));
}
catch (System.Exception ) {
}
}
protected override void DetachSink() {
try {
this.cookie.Disconnect();
}
catch (System.Exception ) {
}
}
protected override void AttachInterfaces() {
try {
this.ocx = ((MSHelpControls.IHxTreeView)(this.GetOcx()));
}
catch (System.Exception ) {
}
}
internal void RaiseOnNodeClick(object sender, IHxTreeViewEvents_NodeClickEvent e) {
if ((this.NodeClick != null)) {
this.NodeClick(sender, e);
}
}
internal void RaiseOnNodeRightClick(object sender, IHxTreeViewEvents_NodeRightClickEvent e) {
if ((this.NodeRightClick != null)) {
this.NodeRightClick(sender, e);
}
}
}
public delegate void IHxTreeViewEvents_NodeClickEventHandler(object sender, IHxTreeViewEvents_NodeClickEvent e);
public class IHxTreeViewEvents_NodeClickEvent {
public int hNode;
public IHxTreeViewEvents_NodeClickEvent(int hNode) {
this.hNode = hNode;
}
}
public delegate void IHxTreeViewEvents_NodeRightClickEventHandler(object sender, IHxTreeViewEvents_NodeRightClickEvent e);
public class IHxTreeViewEvents_NodeRightClickEvent {
public int hNode;
public int x;
public int y;
public IHxTreeViewEvents_NodeRightClickEvent(int hNode, int x, int y) {
this.hNode = hNode;
this.x = x;
this.y = y;
}
}
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
public class AxHxTocCtrlEventMulticaster : MSHelpControls.IHxTreeViewEvents {
private AxHxTocCtrl parent;
public AxHxTocCtrlEventMulticaster(AxHxTocCtrl parent) {
this.parent = parent;
}
public virtual void NodeClick(int hNode) {
IHxTreeViewEvents_NodeClickEvent nodeclickEvent = new IHxTreeViewEvents_NodeClickEvent(hNode);
this.parent.RaiseOnNodeClick(this.parent, nodeclickEvent);
}
public virtual void NodeRightClick(int hNode, int x, int y) {
IHxTreeViewEvents_NodeRightClickEvent noderightclickEvent = new IHxTreeViewEvents_NodeRightClickEvent(hNode, x, y);
this.parent.RaiseOnNodeRightClick(this.parent, noderightclickEvent);
}
}
[System.Windows.Forms.AxHost.ClsidAttribute("{314111c6-a502-11d2-bbca-00c04f8ec294}")]
[System.ComponentModel.DesignTimeVisibleAttribute(true)]
public class AxHxIndexCtrl : System.Windows.Forms.AxHost {
private MSHelpControls.IHxIndexView ocx;
private AxHxIndexCtrlEventMulticaster eventMulticaster;
private System.Windows.Forms.AxHost.ConnectionPointCookie cookie;
public AxHxIndexCtrl() :
base("314111c6-a502-11d2-bbca-00c04f8ec294") {
}
[System.ComponentModel.Browsable(false)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(16384)]
public virtual MSHelpServices.IHxIndex IndexData {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("IndexData", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.IndexData;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("IndexData", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.IndexData = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(16385)]
public virtual int Selection {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Selection", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.Selection;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Selection", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.Selection = value;
}
}
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-501)]
[System.Runtime.InteropServices.ComAliasNameAttribute("System.UInt32")]
public override System.Drawing.Color BackColor {
get {
if (((this.ocx != null)
&& (this.PropsValid() == true))) {
return GetColorFromOleColor(((uint)(this.ocx.BackColor)));
}
else {
return base.BackColor;
}
}
set {
base.BackColor = value;
if ((this.ocx != null)) {
this.ocx.BackColor = ((uint)(GetOleColorFromColor(value)));
}
}
}
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-513)]
[System.Runtime.InteropServices.ComAliasNameAttribute("System.UInt32")]
public override System.Drawing.Color ForeColor {
get {
if (((this.ocx != null)
&& (this.PropsValid() == true))) {
return GetColorFromOleColor(((uint)(this.ocx.ForeColor)));
}
else {
return base.ForeColor;
}
}
set {
base.ForeColor = value;
if ((this.ocx != null)) {
this.ocx.ForeColor = ((uint)(GetOleColorFromColor(value)));
}
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-504)]
public virtual MSHelpControls.HxBorderStyle BorderStyle {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("BorderStyle", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.BorderStyle;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("BorderStyle", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.BorderStyle = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-520)]
public virtual MSHelpControls.HxAppearanceConstant Appearance {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Appearance", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.Appearance;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Appearance", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.Appearance = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-521)]
public virtual MSHelpControls.HxMousePointerConstant MousePointer {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("MousePointer", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.MousePointer;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("MousePointer", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.MousePointer = value;
}
}
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-512)]
[System.Runtime.InteropServices.ComAliasNameAttribute("stdole.StdFont")]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public override System.Drawing.Font Font {
get {
if (((this.ocx != null)
&& (this.PropsValid() == true))) {
return GetFontFromIFont(this.ocx.Font);
}
else {
return base.Font;
}
}
set {
base.Font = value;
if ((this.ocx != null)) {
this.ocx.Font = ((stdole.StdFont)(GetIFontFromFont(value)));
}
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(16388)]
[System.Runtime.InteropServices.ComAliasNameAttribute("System.UInt32")]
public virtual System.Drawing.Color HighlightForeColor {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("HighlightForeColor", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return GetColorFromOleColor(((uint)(this.ocx.HighlightForeColor)));
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("HighlightForeColor", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.HighlightForeColor = ((uint)(GetOleColorFromColor(value)));
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(16389)]
[System.Runtime.InteropServices.ComAliasNameAttribute("System.UInt32")]
public virtual System.Drawing.Color HighlightBackColor {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("HighlightBackColor", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return GetColorFromOleColor(((uint)(this.ocx.HighlightBackColor)));
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("HighlightBackColor", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.HighlightBackColor = ((uint)(GetOleColorFromColor(value)));
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(16390)]
[System.Runtime.InteropServices.ComAliasNameAttribute("System.UInt32")]
public virtual System.Drawing.Color FocusHighlightForeColor {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("FocusHighlightForeColor", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return GetColorFromOleColor(((uint)(this.ocx.FocusHighlightForeColor)));
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("FocusHighlightForeColor", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.FocusHighlightForeColor = ((uint)(GetOleColorFromColor(value)));
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(16391)]
[System.Runtime.InteropServices.ComAliasNameAttribute("System.UInt32")]
public virtual System.Drawing.Color FocusHighlightBackColor {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("FocusHighlightBackColor", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return GetColorFromOleColor(((uint)(this.ocx.FocusHighlightBackColor)));
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("FocusHighlightBackColor", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.FocusHighlightBackColor = ((uint)(GetOleColorFromColor(value)));
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(16392)]
public virtual short LangId {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("LangId", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.LangId;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("LangId", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.LangId = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(16393)]
public virtual MSHelpControls.HxFontSourceConstant FontSource {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("FontSource", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.FontSource;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("FontSource", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.FontSource = value;
}
}
public event IHxIndexViewEvents_ItemClickEventHandler ItemClick;
public event IHxIndexViewEvents_ItemSelectEventHandler ItemSelect;
public virtual void SelectItem(int iItem) {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("SelectItem", System.Windows.Forms.AxHost.ActiveXInvokeKind.MethodInvoke);
}
this.ocx.SelectItem(iItem);
}
public virtual void ClickItem(int iItem) {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("ClickItem", System.Windows.Forms.AxHost.ActiveXInvokeKind.MethodInvoke);
}
this.ocx.ClickItem(iItem);
}
public override void Refresh() {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Refresh", System.Windows.Forms.AxHost.ActiveXInvokeKind.MethodInvoke);
}
this.ocx.Refresh();
}
protected override void CreateSink() {
try {
this.eventMulticaster = new AxHxIndexCtrlEventMulticaster(this);
this.cookie = new System.Windows.Forms.AxHost.ConnectionPointCookie(this.ocx, this.eventMulticaster, typeof(MSHelpControls.IHxIndexViewEvents));
}
catch (System.Exception ) {
}
}
protected override void DetachSink() {
try {
this.cookie.Disconnect();
}
catch (System.Exception ) {
}
}
protected override void AttachInterfaces() {
try {
this.ocx = ((MSHelpControls.IHxIndexView)(this.GetOcx()));
}
catch (System.Exception ) {
}
}
internal void RaiseOnItemClick(object sender, IHxIndexViewEvents_ItemClickEvent e) {
if ((this.ItemClick != null)) {
this.ItemClick(sender, e);
}
}
internal void RaiseOnItemSelect(object sender, IHxIndexViewEvents_ItemSelectEvent e) {
if ((this.ItemSelect != null)) {
this.ItemSelect(sender, e);
}
}
}
public delegate void IHxIndexViewEvents_ItemClickEventHandler(object sender, IHxIndexViewEvents_ItemClickEvent e);
public class IHxIndexViewEvents_ItemClickEvent {
public int iItem;
public IHxIndexViewEvents_ItemClickEvent(int iItem) {
this.iItem = iItem;
}
}
public delegate void IHxIndexViewEvents_ItemSelectEventHandler(object sender, IHxIndexViewEvents_ItemSelectEvent e);
public class IHxIndexViewEvents_ItemSelectEvent {
public int iItem;
public IHxIndexViewEvents_ItemSelectEvent(int iItem) {
this.iItem = iItem;
}
}
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
public class AxHxIndexCtrlEventMulticaster : MSHelpControls.IHxIndexViewEvents {
private AxHxIndexCtrl parent;
public AxHxIndexCtrlEventMulticaster(AxHxIndexCtrl parent) {
this.parent = parent;
}
public virtual void ItemClick(int iItem) {
IHxIndexViewEvents_ItemClickEvent itemclickEvent = new IHxIndexViewEvents_ItemClickEvent(iItem);
this.parent.RaiseOnItemClick(this.parent, itemclickEvent);
}
public virtual void ItemSelect(int iItem) {
IHxIndexViewEvents_ItemSelectEvent itemselectEvent = new IHxIndexViewEvents_ItemSelectEvent(iItem);
this.parent.RaiseOnItemSelect(this.parent, itemselectEvent);
}
}
}

47
src/AddIns/Misc/HtmlHelp2/Project/src/Service/Help2ControlsValidation.cs

@ -0,0 +1,47 @@ @@ -0,0 +1,47 @@
/* ***********************************************************
*
* Help 2.0 Environment for SharpDevelop
* Base Help 2.0 Services (Help 2.0 Controls Validation)
* Copyright (c) 2005, Mathias Simmack. All rights reserved.
*
* ********************************************************* */
namespace HtmlHelp2Service
{
using System;
using System.IO;
using Microsoft.Win32;
public sealed class Help2ControlsValidation
{
public static bool IsTocControlRegistered
{
get {
return IsClassRegistered("{314111b8-a502-11d2-bbca-00c04f8ec294}");
}
}
public static bool IsIndexControlRegistered
{
get {
return IsClassRegistered("{314111c6-a502-11d2-bbca-00c04f8ec294}");
}
}
private static bool IsClassRegistered(string classId)
{
try {
RegistryKey tempRegKey = Registry.ClassesRoot.OpenSubKey(String.Format("CLSID\\{0}\\InprocServer32", classId));
string help2Dll = (string)tempRegKey.GetValue("");
return (help2Dll != null && help2Dll != "" && File.Exists(help2Dll));
}
catch {
return false;
}
}
public Help2ControlsValidation()
{
}
}
}

89
src/AddIns/Misc/HtmlHelp2/Project/src/Service/Help2RegistryWalker.cs

@ -0,0 +1,89 @@ @@ -0,0 +1,89 @@
/* ***********************************************************
*
* Help 2.0 Environment for SharpDevelop
* Base Help 2.0 Services
* Copyright (c) 2005, Mathias Simmack. All rights reserved.
*
* ********************************************************* */
namespace HtmlHelp2Service
{
using System;
using System.Windows.Forms;
using MSHelpServices;
public sealed class Help2RegistryWalker
{
public static void BuildNamespacesList(ComboBox help2Collections, string selectedHelp2Collection)
{
if(help2Collections == null) {
return;
}
help2Collections.Items.Clear();
help2Collections.BeginUpdate();
try {
string currentDescription = "";
HxRegistryWalker regWalker = new HxRegistryWalker();
IHxRegNamespaceList namespaces = regWalker.get_RegisteredNamespaceList("");
foreach(IHxRegNamespace currentNamespace in namespaces) {
help2Collections.Items.Add((string)currentNamespace.GetProperty(HxRegNamespacePropId.HxRegNamespaceDescription));
if(selectedHelp2Collection != "" && String.Compare(selectedHelp2Collection, currentNamespace.Name) == 0) {
currentDescription = (string)currentNamespace.GetProperty(HxRegNamespacePropId.HxRegNamespaceDescription);
}
}
if(currentDescription != "") help2Collections.SelectedIndex = help2Collections.Items.IndexOf(currentDescription);
else help2Collections.SelectedIndex = 0;
}
catch {
}
help2Collections.EndUpdate();
}
public static string GetNamespaceName(string namespaceDescription)
{
try {
HxRegistryWalker regWalker = new HxRegistryWalker();
IHxRegNamespaceList namespaces = regWalker.get_RegisteredNamespaceList("");
foreach(IHxRegNamespace currentNamespace in namespaces) {
if(String.Compare(namespaceDescription, (string)currentNamespace.GetProperty(HxRegNamespacePropId.HxRegNamespaceDescription)) == 0) {
return currentNamespace.Name;
}
}
return "";
}
catch {
return "";
}
}
public static string GetFirstNamespace(string namespaceName)
{
try {
HxRegistryWalker regWalker = new HxRegistryWalker();
IHxRegNamespaceList namespaces = regWalker.get_RegisteredNamespaceList("");
foreach(IHxRegNamespace currentNamespace in namespaces) {
if(String.Compare(namespaceName, currentNamespace.Name) == 0) {
return namespaceName;
}
}
return namespaces.ItemAt(1).Name;
}
catch {
return "";
}
}
public Help2RegistryWalker()
{
}
}
}

111
src/AddIns/Misc/HtmlHelp2/Project/src/Service/HtmlHelp2Dialog.cs

@ -0,0 +1,111 @@ @@ -0,0 +1,111 @@
/* ***********************************************************
*
* Help 2.0 Environment for SharpDevelop
* Help 2.0 Helper Dialog
* Copyright (c) 2005, Mathias Simmack. All rights reserved.
*
* ********************************************************* */
namespace HtmlHelp2HelperDialog
{
using System;
using System.Drawing;
using System.Windows.Forms;
public class IconPictureBox : PictureBox
{
private Icon icon = null;
public Icon Icon
{
get {
return this.icon;
}
set {
this.icon = value;
base.Image = this.icon.ToBitmap();
}
}
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.DrawIconUnstretched(this.icon, base.ClientRectangle);
}
}
public class HtmlHelp2Dialog : Form
{
private IconPictureBox pictureBox1;
private System.Windows.Forms.Label actionLabel;
public string ActionLabel
{
get {
return actionLabel.Text;
}
set {
actionLabel.Text = value;
}
}
public Icon ActionIcon
{
get {
return pictureBox1.Icon;
}
set {
pictureBox1.Icon = value;
}
}
public HtmlHelp2Dialog()
{
this.InitializeComponent();
pictureBox1.Icon = SystemIcons.Question;
}
#region Windows Forms Designer generated code
/// <summary>
/// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent()
{
this.actionLabel = new System.Windows.Forms.Label();
this.pictureBox1 = new IconPictureBox();
this.SuspendLayout();
//
// actionLabel
//
this.actionLabel.Location = new System.Drawing.Point(66, 16);
this.actionLabel.Name = "actionLabel";
this.actionLabel.Size = new System.Drawing.Size(190, 64);
this.actionLabel.TabIndex = 1;
//
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(16, 16);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(32, 32);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// HtmlHelp2Dialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.ClientSize = new System.Drawing.Size(268, 96);
this.Controls.Add(this.actionLabel);
this.Controls.Add(this.pictureBox1);
this.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "HtmlHelp2Dialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "HtmlHelp2Dialog";
this.ResumeLayout(false);
}
#endregion
}
}

87
src/AddIns/Misc/HtmlHelp2/Project/src/Service/HtmlHelp2Options.cs

@ -0,0 +1,87 @@ @@ -0,0 +1,87 @@
/* ***********************************************************
*
* Help 2.0 Environment for SharpDevelop
* Base Help 2.0 Services (Options Panel)
* Copyright (c) 2005, Mathias Simmack. All rights reserved.
*
* ********************************************************* */
namespace HtmlHelp2Service
{
using System;
using System.Drawing;
using System.Collections;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using System.Xml;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
using MSHelpServices;
public class HtmlHelp2OptionsPanel : AbstractOptionPanel
{
static string help2EnvironmentFile = "help2environment.xml";
bool Help2EnvIsReady = false;
ComboBox help2Collections = null;
string selectedHelp2Collection = "Fidalgo";
public override void LoadPanelContents()
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("HtmlHelp2.Resources.HtmlHelp2Options.xfrm"));
this.InitializeComponents();
}
public override bool StorePanelContents()
{
this.SaveHelp2Config();
HtmlHelp2Environment.ReloadNamespace();
return true;
}
private void InitializeComponents()
{
Help2EnvIsReady = HtmlHelp2Environment.IsReady;
try {
help2Collections = (ComboBox)ControlDictionary["help2Collections"];
help2Collections.Enabled = Help2EnvIsReady;
help2Collections.SelectedIndexChanged += new EventHandler(this.NamespaceNameChanged);
selectedHelp2Collection = HtmlHelp2Environment.CurrentSelectedNamespace;
Help2RegistryWalker.BuildNamespacesList(help2Collections, selectedHelp2Collection);
}
catch {
}
}
private void NamespaceNameChanged(object sender, EventArgs e)
{
if(help2Collections.SelectedItem != null) {
try {
selectedHelp2Collection = Help2RegistryWalker.GetNamespaceName(help2Collections.SelectedItem.ToString());
}
catch {
}
}
}
private void SaveHelp2Config()
{
try {
XmlDocument xmldoc = new XmlDocument();
XmlNode node = null;
XmlCDataSection cdata = null;
xmldoc.LoadXml("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><help2environment/>");
node = xmldoc.CreateElement("collection");
cdata = xmldoc.CreateCDataSection(selectedHelp2Collection);
node.AppendChild(cdata);
xmldoc.DocumentElement.AppendChild(node);
xmldoc.Save(PropertyService.ConfigDirectory + help2EnvironmentFile);
}
catch {
}
}
}
}

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

@ -0,0 +1,317 @@ @@ -0,0 +1,317 @@
/* ***********************************************************
*
* Help 2.0 Environment for SharpDevelop
* Base Help 2.0 Services
* Copyright (c) 2005, Mathias Simmack. All rights reserved.
*
* ********************************************************* */
namespace HtmlHelp2Service
{
using System;
using System.Windows.Forms;
using System.Xml;
using ICSharpCode.Core;
using MSHelpServices;
using HtmlHelp2HelperDialog;
public sealed class HtmlHelp2Environment
{
static string help2EnvironmentFile = "help2environment.xml";
static Guid TocGuid = new Guid("314111B2-A502-11D2-BBCA-00C04F8EC294");
static Guid IndexGuid = new Guid("314111CC-A502-11D2-BBCA-00C04F8EC294");
static Guid QueryGuid = new Guid("31411193-A502-11D2-BBCA-00C04F8EC294");
static HxSession session = null;
static IHxRegFilterList namespaceFilters = null;
static IHxQuery fulltextSearch = null;
static IHxQuery dynamicHelp = null;
static string fidalgoNamespaceName = "Corsavy";
static string currentSelectedFilterQuery = "";
static string currentSelectedFilterName = "";
static string defaultPage = "about:blank";
static string searchPage = "http://msdn.microsoft.com";
static bool dynamicHelpIsBusy = false;
static HtmlHelp2Environment()
{
LoadHelp2Config();
fidalgoNamespaceName = Help2RegistryWalker.GetFirstNamespace(fidalgoNamespaceName);
InitializeNamespace(fidalgoNamespaceName);
}
#region Properties
public static bool IsReady
{
get {
return session != null;
}
}
public static string CurrentSelectedNamespace
{
get {
return fidalgoNamespaceName;
}
}
public static string CurrentFilterQuery
{
get {
return currentSelectedFilterQuery;
}
}
public static string CurrentFilterName
{
get {
return currentSelectedFilterName;
}
}
public static string DefaultPage
{
get {
return defaultPage;
}
}
public static string SearchPage
{
get {
return searchPage;
}
}
public static IHxQuery FTS
{
get {
return fulltextSearch;
}
}
public static bool DynamicHelpIsBusy
{
get {
return dynamicHelpIsBusy;
}
}
#endregion
#region Namespace Functions
private static void LoadHelp2Config()
{
try {
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(PropertyService.ConfigDirectory + help2EnvironmentFile);
XmlNode node = xmldoc.SelectSingleNode("/help2environment/collection");
if(node != null) fidalgoNamespaceName = node.InnerText;
}
catch {
}
}
public static void ReloadNamespace()
{
LoadHelp2Config();
fidalgoNamespaceName = Help2RegistryWalker.GetFirstNamespace(fidalgoNamespaceName);
InitializeNamespace(fidalgoNamespaceName);
OnNamespaceReloaded(EventArgs.Empty);
}
private static void InitializeNamespace(string namespaceName)
{
if(namespaceName == null || namespaceName == "") {
return;
}
if(session != null) session = null;
try {
currentSelectedFilterQuery = "";
currentSelectedFilterName = "";
HtmlHelp2Dialog initDialog = new HtmlHelp2Dialog();
initDialog.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.HelpUpdateCaption}");
initDialog.ActionLabel = StringParser.Parse("${res:AddIns.HtmlHelp2.HelpUpdateInProgress}");
initDialog.Show();
Application.DoEvents();
session = new HxSession();
session.Initialize(String.Format("ms-help://{0}", namespaceName), 0);
namespaceFilters = session.GetFilterList();
ReloadDefaultPages();
ReloadFTSSystem();
ReloadDynamicHelpSystem();
initDialog.Dispose();
}
catch {
session = null;
}
}
private static void ReloadFTSSystem()
{
try {
fulltextSearch = (IHxQuery)session.GetNavigationInterface("!DefaultFullTextSearch", currentSelectedFilterQuery, ref QueryGuid);
}
catch {
fulltextSearch = null;
}
}
private static void ReloadDynamicHelpSystem()
{
try {
dynamicHelp = (IHxQuery)session.GetNavigationInterface("!DefaultContextWindowIndex", currentSelectedFilterQuery, ref QueryGuid);
}
catch {
dynamicHelp = null;
}
}
private static void ReloadDefaultPages()
{
try {
defaultPage = GetDefaultPage("HomePage", "DefaultPage", "about:blank");
searchPage = GetDefaultPage("SearchHelpPage", "SearchWebPage", "http://msdn.microsoft.com");
}
catch {
}
}
private static string GetDefaultPage(string pageName, string alternatePageName, string defaultValue)
{
string resultString = "";
try {
IHxIndex namedUrlIndex = (IHxIndex)session.GetNavigationInterface("!DefaultNamedUrlIndex", "", ref IndexGuid);
IHxTopicList topics = null;
topics = namedUrlIndex.GetTopicsFromString(pageName, 0);
if(topics.Count == 0 && (alternatePageName != null && alternatePageName != "")) {
topics = namedUrlIndex.GetTopicsFromString(alternatePageName, 0);
}
if(topics.Count > 0) resultString = topics.ItemAt(1).URL;
else resultString = defaultValue;
return resultString;
}
catch {
return "";
}
}
public static IHxHierarchy GetTocHierarchy(string filterQuery)
{
try {
IHxHierarchy defaultToc = (IHxHierarchy)session.GetNavigationInterface("!DefaultTOC", filterQuery, ref TocGuid);
return defaultToc;
}
catch {
return null;
}
}
public static IHxIndex GetIndex(string filterQuery)
{
try {
IHxIndex defaultIndex = (IHxIndex)session.GetNavigationInterface("!DefaultKeywordIndex", filterQuery, ref IndexGuid);
return defaultIndex;
}
catch {
return null;
}
}
public static void BuildFilterList(ComboBox filterCombobox)
{
filterCombobox.Items.Clear();
filterCombobox.BeginUpdate();
try {
for(int i = 1; i <= namespaceFilters.Count; i++) {
IHxRegFilter filter = namespaceFilters.ItemAt(i);
string filterName = (string)filter.GetProperty(HxRegFilterPropId.HxRegFilterName);
filterCombobox.Items.Add(filterName);
if(currentSelectedFilterName == "" && i == 1) {
currentSelectedFilterName = filterName;
}
}
if(namespaceFilters.Count == 0) filterCombobox.Items.Add(StringParser.Parse("${res:AddIns.HtmlHelp2.DefaultEmptyFilter}"));
if(currentSelectedFilterName == "") filterCombobox.SelectedIndex = 0;
else filterCombobox.SelectedIndex = filterCombobox.Items.IndexOf(currentSelectedFilterName);
}
catch {
}
filterCombobox.EndUpdate();
}
public static string FindFilterQuery(string filterName)
{
if(String.Compare(filterName, currentSelectedFilterName) == 0) {
return currentSelectedFilterQuery;
}
try {
IHxRegFilter filter = namespaceFilters.FindFilter(filterName);
currentSelectedFilterQuery = (string)filter.GetProperty(HxRegFilterPropId.HxRegFilterQuery);
currentSelectedFilterName = filterName;
OnFilterQueryChanged(EventArgs.Empty);
ReloadFTSSystem();
ReloadDynamicHelpSystem();
ReloadDefaultPages();
return currentSelectedFilterQuery;
}
catch {
return "";
}
}
public static IHxTopicList GetMatchingTopicsForDynamicHelp(string searchTerm)
{
if(dynamicHelpIsBusy) {
return null;
}
try {
dynamicHelpIsBusy = true;
IHxTopicList topics = ((IHxIndex)dynamicHelp).GetTopicsFromString(searchTerm, 0);
return topics;
}
finally {
dynamicHelpIsBusy = false;
}
}
#endregion
#region Event Handling
public static event EventHandler FilterQueryChanged;
public static event EventHandler NamespaceReloaded;
private static void OnFilterQueryChanged(EventArgs e)
{
if(FilterQueryChanged != null) {
FilterQueryChanged(null, e);
}
}
private static void OnNamespaceReloaded(EventArgs e)
{
if(NamespaceReloaded != null) {
NamespaceReloaded(null, e);
}
}
#endregion
}
}

43
src/AddIns/Misc/HtmlHelp2/Project/src/Service/ResourcesHelper.cs

@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
/* ***********************************************************
*
* Help 2.0 Environment for SharpDevelop
* Base Help 2.0 Services
* Copyright (c) 2005, Mathias Simmack. All rights reserved.
*
* ********************************************************* */
namespace HtmlHelp2Service
{
using System;
using System.Drawing;
using System.Reflection;
using System.Resources;
public sealed class ResourcesHelper
{
static ResourcesHelper instance;
static ResourcesHelper()
{
instance = new ResourcesHelper();
}
public static Bitmap GetBitmap(string resourceName)
{
Assembly assembly = typeof(ResourcesHelper).Assembly;
string fullName = String.Format("HtmlHelp2.Resources.{0}", resourceName);
return new Bitmap(assembly.GetManifestResourceStream(fullName));
}
public static Image GetImage(string imageName)
{
return instance.ImageResourceHelper.GetObject(imageName) as Image;
}
ResourceManager ImageResourceHelper;
ResourcesHelper()
{
ImageResourceHelper = new ResourceManager("HtmlHelp2.Resources", GetType().Assembly);
}
}
}

769
src/AddIns/Misc/HtmlHelp2/RequiredLibraries/AxMSHelpControls.cs

@ -0,0 +1,769 @@ @@ -0,0 +1,769 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50215.44
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: System.Reflection.AssemblyVersion("1.0.0.0")]
[assembly: System.Windows.Forms.AxHost.TypeLibraryTimeStamp("09.04.2005 00:38:34")]
namespace AxMSHelpControls {
[System.Windows.Forms.AxHost.ClsidAttribute("{314111b8-a502-11d2-bbca-00c04f8ec294}")]
[System.ComponentModel.DesignTimeVisibleAttribute(true)]
public class AxHxTocCtrl : System.Windows.Forms.AxHost {
private MSHelpControls.IHxTreeView ocx;
private AxHxTocCtrlEventMulticaster eventMulticaster;
private System.Windows.Forms.AxHost.ConnectionPointCookie cookie;
public AxHxTocCtrl() :
base("314111b8-a502-11d2-bbca-00c04f8ec294") {
}
[System.ComponentModel.Browsable(false)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(4096)]
public virtual MSHelpServices.IHxHierarchy Hierarchy {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Hierarchy", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.Hierarchy;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Hierarchy", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.Hierarchy = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(4100)]
public virtual int ImageList {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("ImageList", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.ImageList;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("ImageList", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.ImageList = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(4097)]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public virtual bool HideSelection {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("HideSelection", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.HideSelection;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("HideSelection", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.HideSelection = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(4098)]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public virtual MSHelpControls.HxTreeLineStyleConstant LineStyle {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("LineStyle", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.LineStyle;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("LineStyle", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.LineStyle = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(4099)]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public virtual MSHelpControls.HxTreeStyleConstant TreeStyle {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("TreeStyle", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.TreeStyle;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("TreeStyle", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.TreeStyle = value;
}
}
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-501)]
[System.Runtime.InteropServices.ComAliasNameAttribute("System.UInt32")]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public override System.Drawing.Color BackColor {
get {
if (((this.ocx != null)
&& (this.PropsValid() == true))) {
return GetColorFromOleColor(((uint)(this.ocx.BackColor)));
}
else {
return base.BackColor;
}
}
set {
base.BackColor = value;
if ((this.ocx != null)) {
this.ocx.BackColor = ((uint)(GetOleColorFromColor(value)));
}
}
}
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-513)]
[System.Runtime.InteropServices.ComAliasNameAttribute("System.UInt32")]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public override System.Drawing.Color ForeColor {
get {
if (((this.ocx != null)
&& (this.PropsValid() == true))) {
return GetColorFromOleColor(((uint)(this.ocx.ForeColor)));
}
else {
return base.ForeColor;
}
}
set {
base.ForeColor = value;
if ((this.ocx != null)) {
this.ocx.ForeColor = ((uint)(GetOleColorFromColor(value)));
}
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-504)]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public virtual MSHelpControls.HxBorderStyle BorderStyle {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("BorderStyle", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.BorderStyle;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("BorderStyle", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.BorderStyle = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-520)]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public virtual MSHelpControls.HxAppearanceConstant Appearance {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Appearance", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.Appearance;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Appearance", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.Appearance = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-521)]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public virtual MSHelpControls.HxMousePointerConstant MousePointer {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("MousePointer", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.MousePointer;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("MousePointer", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.MousePointer = value;
}
}
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-512)]
[System.Runtime.InteropServices.ComAliasNameAttribute("stdole.StdFont")]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public override System.Drawing.Font Font {
get {
if (((this.ocx != null)
&& (this.PropsValid() == true))) {
return GetFontFromIFont(this.ocx.Font);
}
else {
return base.Font;
}
}
set {
base.Font = value;
if ((this.ocx != null)) {
this.ocx.Font = ((stdole.StdFont)(GetIFontFromFont(value)));
}
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(4102)]
public virtual int Selection {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Selection", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.Selection;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(4103)]
public virtual short LangId {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("LangId", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.LangId;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("LangId", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.LangId = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(4104)]
public virtual MSHelpControls.HxFontSourceConstant FontSource {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("FontSource", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.FontSource;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("FontSource", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.FontSource = value;
}
}
public event IHxTreeViewEvents_NodeClickEventHandler NodeClick;
public event IHxTreeViewEvents_NodeRightClickEventHandler NodeRightClick;
public virtual void Refresh() {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Refresh", System.Windows.Forms.AxHost.ActiveXInvokeKind.MethodInvoke);
}
this.ocx.Refresh();
}
public virtual void Synchronize(string bstrURL) {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Synchronize", System.Windows.Forms.AxHost.ActiveXInvokeKind.MethodInvoke);
}
this.ocx.Synchronize(bstrURL);
}
protected override void CreateSink() {
try {
this.eventMulticaster = new AxHxTocCtrlEventMulticaster(this);
this.cookie = new System.Windows.Forms.AxHost.ConnectionPointCookie(this.ocx, this.eventMulticaster, typeof(MSHelpControls.IHxTreeViewEvents));
}
catch (System.Exception ) {
}
}
protected override void DetachSink() {
try {
this.cookie.Disconnect();
}
catch (System.Exception ) {
}
}
protected override void AttachInterfaces() {
try {
this.ocx = ((MSHelpControls.IHxTreeView)(this.GetOcx()));
}
catch (System.Exception ) {
}
}
internal void RaiseOnNodeClick(object sender, IHxTreeViewEvents_NodeClickEvent e) {
if ((this.NodeClick != null)) {
this.NodeClick(sender, e);
}
}
internal void RaiseOnNodeRightClick(object sender, IHxTreeViewEvents_NodeRightClickEvent e) {
if ((this.NodeRightClick != null)) {
this.NodeRightClick(sender, e);
}
}
}
public delegate void IHxTreeViewEvents_NodeClickEventHandler(object sender, IHxTreeViewEvents_NodeClickEvent e);
public class IHxTreeViewEvents_NodeClickEvent {
public int hNode;
public IHxTreeViewEvents_NodeClickEvent(int hNode) {
this.hNode = hNode;
}
}
public delegate void IHxTreeViewEvents_NodeRightClickEventHandler(object sender, IHxTreeViewEvents_NodeRightClickEvent e);
public class IHxTreeViewEvents_NodeRightClickEvent {
public int hNode;
public int x;
public int y;
public IHxTreeViewEvents_NodeRightClickEvent(int hNode, int x, int y) {
this.hNode = hNode;
this.x = x;
this.y = y;
}
}
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
public class AxHxTocCtrlEventMulticaster : MSHelpControls.IHxTreeViewEvents {
private AxHxTocCtrl parent;
public AxHxTocCtrlEventMulticaster(AxHxTocCtrl parent) {
this.parent = parent;
}
public virtual void NodeClick(int hNode) {
IHxTreeViewEvents_NodeClickEvent nodeclickEvent = new IHxTreeViewEvents_NodeClickEvent(hNode);
this.parent.RaiseOnNodeClick(this.parent, nodeclickEvent);
}
public virtual void NodeRightClick(int hNode, int x, int y) {
IHxTreeViewEvents_NodeRightClickEvent noderightclickEvent = new IHxTreeViewEvents_NodeRightClickEvent(hNode, x, y);
this.parent.RaiseOnNodeRightClick(this.parent, noderightclickEvent);
}
}
[System.Windows.Forms.AxHost.ClsidAttribute("{314111c6-a502-11d2-bbca-00c04f8ec294}")]
[System.ComponentModel.DesignTimeVisibleAttribute(true)]
public class AxHxIndexCtrl : System.Windows.Forms.AxHost {
private MSHelpControls.IHxIndexView ocx;
private AxHxIndexCtrlEventMulticaster eventMulticaster;
private System.Windows.Forms.AxHost.ConnectionPointCookie cookie;
public AxHxIndexCtrl() :
base("314111c6-a502-11d2-bbca-00c04f8ec294") {
}
[System.ComponentModel.Browsable(false)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(16384)]
public virtual MSHelpServices.IHxIndex IndexData {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("IndexData", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.IndexData;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("IndexData", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.IndexData = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(16385)]
public virtual int Selection {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Selection", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.Selection;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Selection", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.Selection = value;
}
}
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-501)]
[System.Runtime.InteropServices.ComAliasNameAttribute("System.UInt32")]
public override System.Drawing.Color BackColor {
get {
if (((this.ocx != null)
&& (this.PropsValid() == true))) {
return GetColorFromOleColor(((uint)(this.ocx.BackColor)));
}
else {
return base.BackColor;
}
}
set {
base.BackColor = value;
if ((this.ocx != null)) {
this.ocx.BackColor = ((uint)(GetOleColorFromColor(value)));
}
}
}
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-513)]
[System.Runtime.InteropServices.ComAliasNameAttribute("System.UInt32")]
public override System.Drawing.Color ForeColor {
get {
if (((this.ocx != null)
&& (this.PropsValid() == true))) {
return GetColorFromOleColor(((uint)(this.ocx.ForeColor)));
}
else {
return base.ForeColor;
}
}
set {
base.ForeColor = value;
if ((this.ocx != null)) {
this.ocx.ForeColor = ((uint)(GetOleColorFromColor(value)));
}
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-504)]
public virtual MSHelpControls.HxBorderStyle BorderStyle {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("BorderStyle", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.BorderStyle;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("BorderStyle", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.BorderStyle = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-520)]
public virtual MSHelpControls.HxAppearanceConstant Appearance {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Appearance", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.Appearance;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Appearance", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.Appearance = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-521)]
public virtual MSHelpControls.HxMousePointerConstant MousePointer {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("MousePointer", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.MousePointer;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("MousePointer", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.MousePointer = value;
}
}
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(-512)]
[System.Runtime.InteropServices.ComAliasNameAttribute("stdole.StdFont")]
[System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public override System.Drawing.Font Font {
get {
if (((this.ocx != null)
&& (this.PropsValid() == true))) {
return GetFontFromIFont(this.ocx.Font);
}
else {
return base.Font;
}
}
set {
base.Font = value;
if ((this.ocx != null)) {
this.ocx.Font = ((stdole.StdFont)(GetIFontFromFont(value)));
}
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(16388)]
[System.Runtime.InteropServices.ComAliasNameAttribute("System.UInt32")]
public virtual System.Drawing.Color HighlightForeColor {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("HighlightForeColor", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return GetColorFromOleColor(((uint)(this.ocx.HighlightForeColor)));
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("HighlightForeColor", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.HighlightForeColor = ((uint)(GetOleColorFromColor(value)));
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(16389)]
[System.Runtime.InteropServices.ComAliasNameAttribute("System.UInt32")]
public virtual System.Drawing.Color HighlightBackColor {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("HighlightBackColor", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return GetColorFromOleColor(((uint)(this.ocx.HighlightBackColor)));
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("HighlightBackColor", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.HighlightBackColor = ((uint)(GetOleColorFromColor(value)));
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(16390)]
[System.Runtime.InteropServices.ComAliasNameAttribute("System.UInt32")]
public virtual System.Drawing.Color FocusHighlightForeColor {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("FocusHighlightForeColor", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return GetColorFromOleColor(((uint)(this.ocx.FocusHighlightForeColor)));
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("FocusHighlightForeColor", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.FocusHighlightForeColor = ((uint)(GetOleColorFromColor(value)));
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(16391)]
[System.Runtime.InteropServices.ComAliasNameAttribute("System.UInt32")]
public virtual System.Drawing.Color FocusHighlightBackColor {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("FocusHighlightBackColor", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return GetColorFromOleColor(((uint)(this.ocx.FocusHighlightBackColor)));
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("FocusHighlightBackColor", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.FocusHighlightBackColor = ((uint)(GetOleColorFromColor(value)));
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(16392)]
public virtual short LangId {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("LangId", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.LangId;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("LangId", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.LangId = value;
}
}
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.Runtime.InteropServices.DispIdAttribute(16393)]
public virtual MSHelpControls.HxFontSourceConstant FontSource {
get {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("FontSource", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertyGet);
}
return this.ocx.FontSource;
}
set {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("FontSource", System.Windows.Forms.AxHost.ActiveXInvokeKind.PropertySet);
}
this.ocx.FontSource = value;
}
}
public event IHxIndexViewEvents_ItemClickEventHandler ItemClick;
public event IHxIndexViewEvents_ItemSelectEventHandler ItemSelect;
public virtual void SelectItem(int iItem) {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("SelectItem", System.Windows.Forms.AxHost.ActiveXInvokeKind.MethodInvoke);
}
this.ocx.SelectItem(iItem);
}
public virtual void ClickItem(int iItem) {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("ClickItem", System.Windows.Forms.AxHost.ActiveXInvokeKind.MethodInvoke);
}
this.ocx.ClickItem(iItem);
}
public virtual void Refresh() {
if ((this.ocx == null)) {
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("Refresh", System.Windows.Forms.AxHost.ActiveXInvokeKind.MethodInvoke);
}
this.ocx.Refresh();
}
protected override void CreateSink() {
try {
this.eventMulticaster = new AxHxIndexCtrlEventMulticaster(this);
this.cookie = new System.Windows.Forms.AxHost.ConnectionPointCookie(this.ocx, this.eventMulticaster, typeof(MSHelpControls.IHxIndexViewEvents));
}
catch (System.Exception ) {
}
}
protected override void DetachSink() {
try {
this.cookie.Disconnect();
}
catch (System.Exception ) {
}
}
protected override void AttachInterfaces() {
try {
this.ocx = ((MSHelpControls.IHxIndexView)(this.GetOcx()));
}
catch (System.Exception ) {
}
}
internal void RaiseOnItemClick(object sender, IHxIndexViewEvents_ItemClickEvent e) {
if ((this.ItemClick != null)) {
this.ItemClick(sender, e);
}
}
internal void RaiseOnItemSelect(object sender, IHxIndexViewEvents_ItemSelectEvent e) {
if ((this.ItemSelect != null)) {
this.ItemSelect(sender, e);
}
}
}
public delegate void IHxIndexViewEvents_ItemClickEventHandler(object sender, IHxIndexViewEvents_ItemClickEvent e);
public class IHxIndexViewEvents_ItemClickEvent {
public int iItem;
public IHxIndexViewEvents_ItemClickEvent(int iItem) {
this.iItem = iItem;
}
}
public delegate void IHxIndexViewEvents_ItemSelectEventHandler(object sender, IHxIndexViewEvents_ItemSelectEvent e);
public class IHxIndexViewEvents_ItemSelectEvent {
public int iItem;
public IHxIndexViewEvents_ItemSelectEvent(int iItem) {
this.iItem = iItem;
}
}
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
public class AxHxIndexCtrlEventMulticaster : MSHelpControls.IHxIndexViewEvents {
private AxHxIndexCtrl parent;
public AxHxIndexCtrlEventMulticaster(AxHxIndexCtrl parent) {
this.parent = parent;
}
public virtual void ItemClick(int iItem) {
IHxIndexViewEvents_ItemClickEvent itemclickEvent = new IHxIndexViewEvents_ItemClickEvent(iItem);
this.parent.RaiseOnItemClick(this.parent, itemclickEvent);
}
public virtual void ItemSelect(int iItem) {
IHxIndexViewEvents_ItemSelectEvent itemselectEvent = new IHxIndexViewEvents_ItemSelectEvent(iItem);
this.parent.RaiseOnItemSelect(this.parent, itemselectEvent);
}
}
}

BIN
src/AddIns/Misc/HtmlHelp2/RequiredLibraries/MSHelpControls.dll

Binary file not shown.

BIN
src/AddIns/Misc/HtmlHelp2/RequiredLibraries/MSHelpServices.dll

Binary file not shown.

15
src/AddIns/Misc/HtmlHelp2/RequiredLibraries/import.bat

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
@echo off
del *.dll
del *.cs
setlocal
set AxImp="C:\Programme\Microsoft Visual Studio 8\SDK\v2.0\Bin\AxImp.exe"
%AxImp% -source "%CommonProgramFiles%\Microsoft Shared\help\hxvz.dll"
set AxImp=
del *.pdb
del Ax*.dll
pause

16
src/AddIns/Misc/HtmlHelp2/RequiredLibraries/import.txt

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
The "MSHelpControls.dll", "MSHelpServices.dll" and the "stdole.dll" are generated .NET wrappers. There is a fourth file, you can find in the "source\HtmlHelp2\Help2Service" folder, called "AxMSHelpControls.cs".
If you want to re-generate the wrapper files, just call the "import.bat" file. But first make sure that all paths are valid. These are the two important lines
set AxImp="K:\Programme\Microsoft.NET\SDK\v2.0\Bin\AxImp.exe"
%AxImp% -source "%CommonProgramFiles%\Microsoft Shared\help\hxvz.dll"
The AxImp tool will create an "AxMSHelpControls.cs" file and an "AxMSHelpControls.dll" file. My addin was build with the CSharp source file. Please copy the re-created version into the "source\HtmlHelp2\Help2Service" folder, overwriting the existing file.
NOTE: It's not necessary to rename the wrapper libraries with some kind of an "Interop." prefix or something like that. There are no native Windows libraries with the same names.
Mathias Simmack
(2005-06-24)

BIN
src/AddIns/Misc/HtmlHelp2/RequiredLibraries/stdole.dll

Binary file not shown.

BIN
src/Main/StartUp/Project/Resources/BitmapResources.resources

Binary file not shown.

3
src/SharpDevelop.sln

@ -28,6 +28,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{CE5B42B7-6 @@ -28,6 +28,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{CE5B42B7-6
ProjectSection(SolutionItems) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HtmlHelp2", "AddIns\Misc\HtmlHelp2\Project\HtmlHelp2.csproj", "{918487B7-2153-4618-BBB3-344DBDDF2A2A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SubversionAddIn", "AddIns\Misc\SubversionAddIn\Project\SubversionAddIn.csproj", "{17F4D7E0-6933-4C2E-8714-FD7E98D625D5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debugger", "Debugger", "{6604365C-C702-4C10-9BA8-637F1E3D4D0D}"
@ -180,6 +182,7 @@ Global @@ -180,6 +182,7 @@ Global
{A82F44D7-F336-4AD6-B2EE-D2C082D094EC} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2}
{6604365C-C702-4C10-9BA8-637F1E3D4D0D} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2}
{17F4D7E0-6933-4C2E-8714-FD7E98D625D5} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2}
{918487B7-2153-4618-BBB3-344DBDDF2A2A} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2}
{B08385CD-F0CC-488C-B4F4-EEB34B6D2688} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D}
{1D18D788-F7EE-4585-A23B-34DC8EC63CB8} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D}
{EC06F96A-AEEC-49D6-B03D-AB87C6EB674C} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D}

Loading…
Cancel
Save