From 529abc2e3d3b43213e32a64da41341ccc8a73042 Mon Sep 17 00:00:00 2001 From: Eusebiu Marcu Date: Fri, 7 Jan 2011 16:40:28 +0200 Subject: [PATCH] support starting urls and attach to the default process (browser or other) resize the web server group --- data/resources/StringResources.resx | 3 + .../Debugger.AddIn/Service/WindowsDebugger.cs | 21 +++- .../ProjectOptions/DebugOptions.cs | 3 +- .../WebProjectOptionsPanel.xaml | 113 +++++++++--------- .../Project/Src/Project/AbstractProject.cs | 2 +- 5 files changed, 77 insertions(+), 65 deletions(-) diff --git a/data/resources/StringResources.resx b/data/resources/StringResources.resx index cc81fab295..1ebec213b4 100644 --- a/data/resources/StringResources.resx +++ b/data/resources/StringResources.resx @@ -3782,6 +3782,9 @@ You can also choose to store the setting in the .user-file instead of the projec Application already exists. + + Debugger was unable to attach to process. + Code Covered diff --git a/src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs b/src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs index bbccdfee99..83818dff69 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs @@ -153,14 +153,14 @@ namespace ICSharpCode.SharpDevelop.Services } var project = ProjectService.CurrentProject as CompilableProject; - + System.Diagnostics.Process localProcess = null; if (project != null) { // start browser if (project.StartAction == StartAction.StartURL) - System.Diagnostics.Process.Start(processStartInfo.FileName); + localProcess = System.Diagnostics.Process.Start(processStartInfo.FileName); else if (!string.IsNullOrEmpty(debugData.Data.ProjectUrl) && debugData.Data.WebServer == WebServer.IIS) - System.Diagnostics.Process.Start("iexplore.exe", debugData.Data.ProjectUrl); + localProcess = System.Diagnostics.Process.Start(debugData.Data.ProjectUrl); } // try debug IIS WP @@ -177,8 +177,16 @@ namespace ICSharpCode.SharpDevelop.Services } if (!attached) { - string format = ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.NoIISWP"); - MessageService.ShowMessage(string.Format(format, processName)); + if(debugData.Data.WebServer == WebServer.IIS) { + string format = ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.NoIISWP"); + MessageService.ShowMessage(string.Format(format, processName)); + } + else { + Attach(localProcess); + if (!attached) { + MessageService.ShowMessage(ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.UnableToAttach")); + } + } } } else { @@ -241,6 +249,9 @@ namespace ICSharpCode.SharpDevelop.Services public void Attach(System.Diagnostics.Process existingProcess) { + if (existingProcess == null) + return; + if (IsDebugging) { MessageService.ShowMessage(errorDebugging); return; diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/DebugOptions.cs b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/DebugOptions.cs index f2678b2880..071bc4e3fb 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/DebugOptions.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/DebugOptions.cs @@ -62,8 +62,9 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels ElementHost host = new ElementHost(); host.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right; host.Height = 160; + host.Width = 550; host.Top = 240; - host.Left = 8; + host.Left = 8; host.Child = new WebProjectOptionsPanel(this); Controls.Add(host); } diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/WebProjectOptions/WebProjectOptionsPanel.xaml b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/WebProjectOptions/WebProjectOptionsPanel.xaml index 479d9929c6..eabce7e8e1 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/WebProjectOptions/WebProjectOptionsPanel.xaml +++ b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/WebProjectOptions/WebProjectOptionsPanel.xaml @@ -1,66 +1,63 @@  - - +> + + + - - - - - - - - - - - - - - - -