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
<data name="ICSharpCode.WepProjectOptionsPanel.ApplicationExists" xml:space="preserve"> <data name="ICSharpCode.WepProjectOptionsPanel.ApplicationExists" xml:space="preserve">
<value>Application already exists.</value> <value>Application already exists.</value>
</data> </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"> <data name="ICSharpCode.CodeCoverage.CodeCovered" xml:space="preserve">
<value>Code Covered</value> <value>Code Covered</value>
</data> </data>

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

@ -153,14 +153,14 @@ namespace ICSharpCode.SharpDevelop.Services
} }
var project = ProjectService.CurrentProject as CompilableProject; var project = ProjectService.CurrentProject as CompilableProject;
System.Diagnostics.Process localProcess = null;
if (project != null) { if (project != null) {
// start browser // start browser
if (project.StartAction == StartAction.StartURL) if (project.StartAction == StartAction.StartURL)
System.Diagnostics.Process.Start(processStartInfo.FileName); localProcess = System.Diagnostics.Process.Start(processStartInfo.FileName);
else else
if (!string.IsNullOrEmpty(debugData.Data.ProjectUrl) && debugData.Data.WebServer == WebServer.IIS) 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 // try debug IIS WP
@ -177,8 +177,16 @@ namespace ICSharpCode.SharpDevelop.Services
} }
if (!attached) { if (!attached) {
string format = ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.NoIISWP"); if(debugData.Data.WebServer == WebServer.IIS) {
MessageService.ShowMessage(string.Format(format, processName)); 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 { else {
@ -241,6 +249,9 @@ namespace ICSharpCode.SharpDevelop.Services
public void Attach(System.Diagnostics.Process existingProcess) public void Attach(System.Diagnostics.Process existingProcess)
{ {
if (existingProcess == null)
return;
if (IsDebugging) { if (IsDebugging) {
MessageService.ShowMessage(errorDebugging); MessageService.ShowMessage(errorDebugging);
return; return;

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

@ -62,8 +62,9 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
ElementHost host = new ElementHost(); ElementHost host = new ElementHost();
host.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right; host.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
host.Height = 160; host.Height = 160;
host.Width = 550;
host.Top = 240; host.Top = 240;
host.Left = 8; host.Left = 8;
host.Child = new WebProjectOptionsPanel(this); host.Child = new WebProjectOptionsPanel(this);
Controls.Add(host); Controls.Add(host);
} }

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

@ -1,66 +1,63 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<UserControl <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" 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 <GroupBox Margin="0, 0, 86, 0"
Orientation="Vertical"> Header="{core:Localize ICSharpCode.WepProjectOptionsPanel.Server}">
<GroupBox <widgets:StackPanelWithSpacing SpaceBetweenItems="5">
Header="{core:Localize ICSharpCode.WepProjectOptionsPanel.Server}"> <!--IIS Express-->
<widgets:StackPanelWithSpacing SpaceBetweenItems="5"> <widgets:StackPanelWithSpacing SpaceBetweenItems="5">
<!--IIS Express--> <RadioButton
<widgets:StackPanelWithSpacing SpaceBetweenItems="5"> IsChecked="False"
<RadioButton GroupName="WebProject"
IsChecked="False" x:Name="UseIISExpress"
GroupName="WebProject" Click="UseIISExpress_Click"
x:Name="UseIISExpress" Content="{core:Localize ICSharpCode.WepProjectOptionsPanel.UseIISExpress}" />
Click="UseIISExpress_Click" </widgets:StackPanelWithSpacing>
Content="{core:Localize ICSharpCode.WepProjectOptionsPanel.UseIISExpress}" /> <!--IIS Local Server-->
</widgets:StackPanelWithSpacing> <widgets:StackPanelWithSpacing SpaceBetweenItems="5">
<!--IIS Local Server--> <RadioButton
<widgets:StackPanelWithSpacing SpaceBetweenItems="5"> IsChecked="False"
<RadioButton GroupName="WebProject"
IsChecked="False" x:Name="UseLocalIIS"
GroupName="WebProject" Click="UseLocalIIS_Click"
x:Name="UseLocalIIS" Content="{core:Localize ICSharpCode.WepProjectOptionsPanel.UseLocalIIS}" />
Click="UseLocalIIS_Click" <Grid Margin="10, 10"
Content="{core:Localize ICSharpCode.WepProjectOptionsPanel.UseLocalIIS}" /> IsEnabled="False"
<Grid Margin="10, 10" x:Name="LocalIISGroup"
IsEnabled="False" VerticalAlignment="Top">
x:Name="LocalIISGroup" <Grid.ColumnDefinitions>
VerticalAlignment="Top"> <ColumnDefinition Width="Auto"/>
<Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions>
<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>
<TextBlock <TextBlock
Foreground="Red" VerticalAlignment="Center"
TextDecorations="Underline" Grid.Row="1"
FontSize="12"
FontWeight="Bold"
TextWrapping="Wrap" TextWrapping="Wrap"
Name="StatusLabel" /> Text="{core:Localize ICSharpCode.WepProjectOptionsPanel.ProjectUrl}" />
</widgets:StackPanelWithSpacing> <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> </widgets:StackPanelWithSpacing>
</GroupBox> </widgets:StackPanelWithSpacing>
</StackPanel> </GroupBox>
</UserControl> </UserControl>

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

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

Loading…
Cancel
Save