Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
Fix view in browser for html files.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrward committed Apr 21, 2012
1 parent b653ce3 commit 5369b65
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 79 deletions.
Expand Up @@ -231,7 +231,6 @@
<Compile Include="Src\SelectedMvcFolder.cs" />
<Compile Include="Src\SelectedMvcViewFolder.cs" />
<Compile Include="Src\SlideBehaviour.cs" />
<Compile Include="Src\ViewInBrowser.cs" />
<Compile Include="Src\ViewModelBase.cs" />
<Compile Include="Src\VisualStudioProjectExtension.cs" />
<Compile Include="Src\WebBehavior.cs" />
Expand Down
77 changes: 0 additions & 77 deletions src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/ViewInBrowser.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/Main/Base/Project/ICSharpCode.SharpDevelop.addin
Expand Up @@ -490,7 +490,7 @@
<Condition name = "Ownerstate" ownerstate = "BehindFile"/>
</Not>
<Condition name="IsProcessRunning" isprocessrunning="False" isdebugging="False"/>
<Condition name = "ViewInBrowser" extensions="aspx,asmx,html,htm,svc"/>
<Condition name = "ViewInBrowser" extensions="html,htm"/>
</And>

<MenuItem id = "ViewInBrowser"
Expand Down
1 change: 1 addition & 0 deletions src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
Expand Up @@ -100,6 +100,7 @@
<DependentUpon>ListViewPad.xaml</DependentUpon>
</Compile>
<Compile Include="Src\Commands\SharpDevelopRoutedCommands.cs" />
<Compile Include="Src\Commands\ViewInBrowser.cs" />
<Compile Include="Src\Editor\AddInHighlightingResource.cs" />
<Compile Include="Src\Editor\AvalonEdit\AvalonEditDocumentAdapter.cs" />
<Compile Include="Src\Editor\AvalonEdit\AvalonEditSyntaxHighlighterAdapter.cs" />
Expand Down
32 changes: 32 additions & 0 deletions src/Main/Base/Project/Src/Commands/ViewInBrowser.cs
@@ -0,0 +1,32 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)

using System;
using System.Diagnostics;
using System.IO;
using System.Linq;

using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui.OptionPanels;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Project.Commands;

namespace ICSharpCode.SharpDevelop.Project.Commands
{
public class ViewInBrowser : AbstractMenuCommand
{
public override void Run()
{
var node = ProjectBrowserPad.Instance.SelectedNode as FileNode;
if (node == null) {
return;
}

try {
Process.Start(node.FileName);
} catch (Exception ex) {
MessageService.ShowMessage(ex.Message);
}
}
}
}

0 comments on commit 5369b65

Please sign in to comment.