Browse Source

support starting urls and attach to the default process (browser or other)

resize the web server group
pull/15/head
Eusebiu Marcu 15 years ago
parent
commit
529abc2e3d
  1. 3
      data/resources/StringResources.resx
  2. 21
      src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs
  3. 3
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/DebugOptions.cs
  4. 113
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/WebProjectOptions/WebProjectOptionsPanel.xaml
  5. 2
      src/Main/Base/Project/Src/Project/AbstractProject.cs

3
data/resources/StringResources.resx

@ -3782,6 +3782,9 @@ You can also choose to store the setting in the .user-file instead of the projec @@ -3782,6 +3782,9 @@ You can also choose to store the setting in the .user-file instead of the projec
<data name="ICSharpCode.WepProjectOptionsPanel.ApplicationExists" xml:space="preserve">
<value>Application already exists.</value>
</data>
<data name="ICSharpCode.WepProjectOptionsPanel.UnableToAttach" xml:space="preserve">
<value>Debugger was unable to attach to process.</value>
</data>
<data name="ICSharpCode.CodeCoverage.CodeCovered" xml:space="preserve">
<value>Code Covered</value>
</data>

21
src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs

@ -153,14 +153,14 @@ namespace ICSharpCode.SharpDevelop.Services @@ -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 @@ -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 @@ -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;

3
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/DebugOptions.cs

@ -62,8 +62,9 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -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);
}

113
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/WebProjectOptions/WebProjectOptionsPanel.xaml

@ -1,66 +1,63 @@ @@ -1,66 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<UserControl
x:Class="ICSharpCode.SharpDevelop.Gui.OptionPanels.WebProjectOptionsPanel" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:core="http://icsharpcode.net/sharpdevelop/core" xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets" xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui;assembly=ICSharpCode.SharpDevelop" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Margin="0, 0, 0, 10">
<StackPanel
Orientation="Vertical">
<GroupBox
Header="{core:Localize ICSharpCode.WepProjectOptionsPanel.Server}">
>
<GroupBox Margin="0, 0, 86, 0"
Header="{core:Localize ICSharpCode.WepProjectOptionsPanel.Server}">
<widgets:StackPanelWithSpacing SpaceBetweenItems="5">
<!--IIS Express-->
<widgets:StackPanelWithSpacing SpaceBetweenItems="5">
<!--IIS Express-->
<widgets:StackPanelWithSpacing SpaceBetweenItems="5">
<RadioButton
IsChecked="False"
GroupName="WebProject"
x:Name="UseIISExpress"
Click="UseIISExpress_Click"
Content="{core:Localize ICSharpCode.WepProjectOptionsPanel.UseIISExpress}" />
</widgets:StackPanelWithSpacing>
<!--IIS Local Server-->
<widgets:StackPanelWithSpacing SpaceBetweenItems="5">
<RadioButton
IsChecked="False"
GroupName="WebProject"
x:Name="UseLocalIIS"
Click="UseLocalIIS_Click"
Content="{core:Localize ICSharpCode.WepProjectOptionsPanel.UseLocalIIS}" />
<Grid Margin="10, 10"
IsEnabled="False"
x:Name="LocalIISGroup"
VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock
VerticalAlignment="Center"
Grid.Row="1"
TextWrapping="Wrap"
Text="{core:Localize ICSharpCode.WepProjectOptionsPanel.ProjectUrl}" />
<TextBox
Grid.Row="1"
Grid.Column="1"
x:Name="ProjectUrl"
TextChanged="ProjectUrl_TextChanged"
MinWidth="250" />
<Button
Grid.Row="1"
Grid.Column="2"
Style="{x:Static core:GlobalStyles.ButtonStyle}"
Name="CreateVirtualDirectoryButton"
Content="{core:Localize ICSharpCode.WepProjectOptionsPanel.CreateVirtualDir}"
Click="CreateVirtualDirectory_Click" />
</Grid>
<RadioButton
IsChecked="False"
GroupName="WebProject"
x:Name="UseIISExpress"
Click="UseIISExpress_Click"
Content="{core:Localize ICSharpCode.WepProjectOptionsPanel.UseIISExpress}" />
</widgets:StackPanelWithSpacing>
<!--IIS Local Server-->
<widgets:StackPanelWithSpacing SpaceBetweenItems="5">
<RadioButton
IsChecked="False"
GroupName="WebProject"
x:Name="UseLocalIIS"
Click="UseLocalIIS_Click"
Content="{core:Localize ICSharpCode.WepProjectOptionsPanel.UseLocalIIS}" />
<Grid Margin="10, 10"
IsEnabled="False"
x:Name="LocalIISGroup"
VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock
Foreground="Red"
TextDecorations="Underline"
FontSize="12"
FontWeight="Bold"
VerticalAlignment="Center"
Grid.Row="1"
TextWrapping="Wrap"
Name="StatusLabel" />
</widgets:StackPanelWithSpacing>
Text="{core:Localize ICSharpCode.WepProjectOptionsPanel.ProjectUrl}" />
<TextBox
Grid.Row="1"
Grid.Column="1"
x:Name="ProjectUrl"
TextChanged="ProjectUrl_TextChanged"
MinWidth="250" />
<Button
Grid.Row="1"
Grid.Column="2"
Style="{x:Static core:GlobalStyles.ButtonStyle}"
Name="CreateVirtualDirectoryButton"
Content="{core:Localize ICSharpCode.WepProjectOptionsPanel.CreateVirtualDir}"
Click="CreateVirtualDirectory_Click" />
</Grid>
<TextBlock
Foreground="Red"
TextDecorations="Underline"
FontSize="12"
FontWeight="Bold"
TextWrapping="Wrap"
Name="StatusLabel" />
</widgets:StackPanelWithSpacing>
</GroupBox>
</StackPanel>
</widgets:StackPanelWithSpacing>
</GroupBox>
</UserControl>

2
src/Main/Base/Project/Src/Project/AbstractProject.cs

@ -382,7 +382,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -382,7 +382,7 @@ namespace ICSharpCode.SharpDevelop.Project
MessageService.ShowError(ex.Message);
return;
}
if (withDebugging && (!FileUtility.IsUrl(psi.FileName) || IsWebProject)) {
if (withDebugging) {
DebuggerService.CurrentDebugger.Start(psi);
} else {
DebuggerService.CurrentDebugger.StartWithoutDebugging(psi);

Loading…
Cancel
Save