5 changed files with 34 additions and 79 deletions
@ -1,77 +0,0 @@
@@ -1,77 +0,0 @@
|
||||
//// 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.IO;
|
||||
//using System.Linq;
|
||||
//
|
||||
//using ICSharpCode.Core;
|
||||
//using ICSharpCode.SharpDevelop.Gui.OptionPanels;
|
||||
//using ICSharpCode.SharpDevelop.Project;
|
||||
//using ICSharpCode.SharpDevelop.Project.Commands;
|
||||
//
|
||||
//namespace ICSharpCode.AspNet.Mvc
|
||||
//{
|
||||
// public class ViewInBrowser : AbstractMenuCommand
|
||||
// {
|
||||
// public override void Run()
|
||||
// {
|
||||
// var node = ProjectBrowserPad.Instance.SelectedNode as FileNode;
|
||||
// if (node == null) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// var project = ProjectService.CurrentProject as CompilableProject;
|
||||
// if (project == null) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (!project.IsWebProject) {
|
||||
// MessageService.ShowError("${res:ProjectComponent.ContextMenu.NotAWebProject}");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (!WebProjectService.IsIISOrIISExpressInstalled) {
|
||||
// MessageService.ShowError("${res:ICSharpCode.WebProjectOptionsPanel.IISNotFound}");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// string fileName = node.FileName;
|
||||
//
|
||||
//// // set project options
|
||||
//// project.StartAction = StartAction.StartURL;
|
||||
//// string directoryName = Path.GetDirectoryName(project.FileName) + "\\";
|
||||
//// project.StartUrl = fileName.Replace(directoryName, "/").Replace("\\", "/");
|
||||
//
|
||||
// // set web server options
|
||||
// string projectName = project.Name;
|
||||
// WebProjectOptions existingOptions = WebProjectsOptions.Instance.GetWebProjectOptions(projectName);
|
||||
//
|
||||
// var options = new WebProjectOptions {
|
||||
// Data = new WebProjectDebugData {
|
||||
// WebServer = WebProjectService.IsIISExpressInstalled ? WebServer.IISExpress : WebServer.IIS,
|
||||
// Port = (existingOptions != null && existingOptions.Data != null) ? existingOptions.Data.Port : "8080", //TODO: port collision detection
|
||||
// ProjectUrl = string.Format("{0}/{1}", WebBehavior.LocalHost, project.Name)
|
||||
// },
|
||||
// ProjectName = projectName
|
||||
// };
|
||||
//
|
||||
// if (options.Data.WebServer == WebServer.IISExpress) {
|
||||
// options.Data.ProjectUrl = string.Format(
|
||||
// @"{0}:{1}/{2}", WebBehavior.LocalHost, options.Data.Port, projectName);
|
||||
// }
|
||||
//
|
||||
// WebProjectsOptions.Instance.SetWebProjectOptions(projectName, options);
|
||||
//
|
||||
// // create virtual directory
|
||||
// string error = WebProjectService.CreateVirtualDirectory(
|
||||
// options.Data.WebServer,
|
||||
// projectName,
|
||||
// Path.GetDirectoryName(ProjectService.CurrentProject.FileName));
|
||||
// LoggingService.Info(error ?? string.Empty);
|
||||
//
|
||||
// // RunProject
|
||||
// new RunProject().Run();
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@ -0,0 +1,32 @@
@@ -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); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
Loading…
Reference in new issue