Browse Source

ShowErrorHelpCommand included and HelpMenu.cs renamed into Commands.cs

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5835 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Mathias Simmack 15 years ago
parent
commit
22ef602258
  1. 12
      src/AddIns/Misc/HelpViewer/HelpViewer.addin
  2. 2
      src/AddIns/Misc/HelpViewer/HelpViewer.csproj
  3. 48
      src/AddIns/Misc/HelpViewer/Source/Commands.cs
  4. 15
      src/AddIns/Misc/HelpViewer/Source/HelpMenu.cs

12
src/AddIns/Misc/HelpViewer/HelpViewer.addin

@ -15,15 +15,19 @@ @@ -15,15 +15,19 @@
<BrowserSchemeExtension id = "ms-xhelp" class = "MSHelpSystem.BrowserScheme"/>
</Path>
<Path path = "/SharpDevelop/Dialogs/OptionsDialog/ToolsOptions">
<OptionPanel id = "Help3Options" label = "Microsoft Help System v1.0" class = "MSHelpSystem.Help3OptionsPanel" />
<Path name="/SharpDevelop/Pads/ErrorList/TaskContextMenu">
<MenuItem id = "Help3ShowErrorHelp" label = "Show Help" class = "MSHelpSystem.Commands.ShowErrorHelpCommand" />
</Path>
<Path name = "/SharpDevelop/Dialogs/OptionsDialog/ToolsOptions">
<OptionPanel id = "Help3Options" label = "Microsoft Help Viewer" class = "MSHelpSystem.Help3OptionsPanel" />
</Path>
<Path name = "/SharpDevelop/Workbench/MainMenu/Help">
<MenuItem id = "Help3DisplayCatalog"
class = "MSHelpSystem.SharpDevelopMenu.DisplayCatalogCommand"
class = "MSHelpSystem.Commands.DisplayCatalogCommand"
label = "Display Help catalog"
shortcut = "Control|Alt|F1"
insertafter = "Help" />
insertbefore = "Separator1" />
</Path>
</AddIn>

2
src/AddIns/Misc/HelpViewer/HelpViewer.csproj

@ -89,7 +89,7 @@ @@ -89,7 +89,7 @@
<Compile Include="Source\Helper\Help3Configuration.cs" />
<Compile Include="Source\Helper\HelpClientWatcher.cs" />
<Compile Include="Source\Helper\ProjectLanguages.cs" />
<Compile Include="Source\HelpMenu.cs" />
<Compile Include="Source\Commands.cs" />
<Compile Include="Source\MSHelp3Provider.cs" />
<Compile Include="Source\Core\NativeMethods.cs" />
</ItemGroup>

48
src/AddIns/Misc/HelpViewer/Source/Commands.cs

@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using MSHelpSystem.Core;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
namespace MSHelpSystem.Commands
{
// <owner name="Siegfried Pammer" email="sie_pam@gmx.at"/>
// <version>$Revision: 3555 $</version>
public class ShowErrorHelpCommand : AbstractMenuCommand
{
public override void Run()
{
ICSharpCode.SharpDevelop.Gui.TaskView view = (TaskView)Owner;
foreach (Task t in new List<Task>(view.SelectedTasks)) {
if (t.BuildError == null)
continue;
string code = t.BuildError.ErrorCode;
if (string.IsNullOrEmpty(code))
return;
if (Help3Environment.IsHelp3ProtocolRegistered) {
LoggingService.Debug(string.Format("Help 3.0: Getting description of \"{0}\"", code));
if (Help3Environment.IsLocalHelp)
DisplayHelp.Keywords(code);
else
DisplayHelp.ContextualHelp(code);
}
else {
LoggingService.Error("Help 3.0: Help system ist not initialized");
}
}
}
}
public class DisplayCatalogCommand : AbstractMenuCommand
{
public override void Run()
{
LoggingService.Info("Help 3.0: Calling menu command \"DisplayHelp.Catalog()\"");
DisplayHelp.Catalog();
}
}
}

15
src/AddIns/Misc/HelpViewer/Source/HelpMenu.cs

@ -1,15 +0,0 @@ @@ -1,15 +0,0 @@
using System;
using MSHelpSystem.Core;
using ICSharpCode.Core;
namespace MSHelpSystem.SharpDevelopMenu
{
public class DisplayCatalogCommand : AbstractMenuCommand
{
public override void Run()
{
LoggingService.Info("Help 3.0: Calling menu command \"DisplayHelp.Catalog()\"");
DisplayHelp.Catalog();
}
}
}
Loading…
Cancel
Save