|
|
@ -25,16 +25,32 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels |
|
|
|
CurrentProjectDebugData = new WebProjectDebugData(); |
|
|
|
CurrentProjectDebugData = new WebProjectDebugData(); |
|
|
|
|
|
|
|
|
|
|
|
Loaded += delegate(object sender, RoutedEventArgs e) { |
|
|
|
Loaded += delegate(object sender, RoutedEventArgs e) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!WebProjectService.IsIISInstalled) { |
|
|
|
|
|
|
|
StatusLabel.Text = ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.IISNotFound"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch (CurrentProjectDebugData.WebServer) |
|
|
|
switch (CurrentProjectDebugData.WebServer) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case WebServer.IISExpress: |
|
|
|
case WebServer.IISExpress: |
|
|
|
|
|
|
|
if (WebProjectService.IISVersion == IISVersion.IISExpress) { |
|
|
|
UseIISExpress.IsChecked = true; |
|
|
|
UseIISExpress.IsChecked = true; |
|
|
|
UseIISExpress_Click(null, null); |
|
|
|
IISExpressGroup.IsEnabled = true; |
|
|
|
|
|
|
|
CreateVirtualDirectoryButton.IsEnabled = true; |
|
|
|
|
|
|
|
PortTextBox.Text = CurrentProjectDebugData.Port; |
|
|
|
|
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case WebServer.IIS: |
|
|
|
case WebServer.IIS: |
|
|
|
|
|
|
|
if (WebProjectService.IISVersion == IISVersion.IIS5 || |
|
|
|
|
|
|
|
WebProjectService.IISVersion == IISVersion.IIS6 || |
|
|
|
|
|
|
|
WebProjectService.IISVersion == IISVersion.IIS7 || |
|
|
|
|
|
|
|
WebProjectService.IISVersion == IISVersion.IIS_Future) { |
|
|
|
UseLocalIIS.IsChecked = true; |
|
|
|
UseLocalIIS.IsChecked = true; |
|
|
|
|
|
|
|
LocalIISGroup.IsEnabled = true; |
|
|
|
|
|
|
|
CreateVirtualDirectoryButton.IsEnabled = true; |
|
|
|
ProjectUrl.Text = CurrentProjectDebugData.ProjectUrl ?? string.Empty; |
|
|
|
ProjectUrl.Text = CurrentProjectDebugData.ProjectUrl ?? string.Empty; |
|
|
|
UseLocalIIS_Click(null, null); |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
// do nothing
|
|
|
|
// do nothing
|
|
|
@ -83,12 +99,20 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels |
|
|
|
{ |
|
|
|
{ |
|
|
|
WebProjectDebugData data = new WebProjectDebugData(); |
|
|
|
WebProjectDebugData data = new WebProjectDebugData(); |
|
|
|
data.WebServer = WebServer.IISExpress; |
|
|
|
data.WebServer = WebServer.IISExpress; |
|
|
|
|
|
|
|
data.Port = PortTextBox.Text; |
|
|
|
|
|
|
|
data.ProjectUrl = string.Format(@"http://localhost:{0}/" + ProjectService.CurrentProject.Name, PortTextBox.Text); |
|
|
|
|
|
|
|
bool isIISExpressInstalled = WebProjectService.IISVersion == IISVersion.IISExpress; |
|
|
|
|
|
|
|
|
|
|
|
if (ProjectService.CurrentProject is CompilableProject) { |
|
|
|
if (!isIISExpressInstalled) { |
|
|
|
((CompilableProject)ProjectService.CurrentProject).StartAction = StartAction.Program; |
|
|
|
UseIISExpress.IsChecked = false; |
|
|
|
parentPanel.SetStartAction(StartAction.Program); |
|
|
|
data.WebServer = WebServer.None; |
|
|
|
|
|
|
|
StatusLabel.Text = ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.IISNotFound"); |
|
|
|
|
|
|
|
data.ProjectUrl = string.Empty; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
StatusLabel.Text = string.Empty; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IISExpressGroup.IsEnabled = CreateVirtualDirectoryButton.IsEnabled = isIISExpressInstalled; |
|
|
|
LocalIISGroup.IsEnabled = false; |
|
|
|
LocalIISGroup.IsEnabled = false; |
|
|
|
CurrentProjectDebugData = data; |
|
|
|
CurrentProjectDebugData = data; |
|
|
|
} |
|
|
|
} |
|
|
@ -97,11 +121,16 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels |
|
|
|
{ |
|
|
|
{ |
|
|
|
WebProjectDebugData data = new WebProjectDebugData(); |
|
|
|
WebProjectDebugData data = new WebProjectDebugData(); |
|
|
|
data.WebServer = WebServer.IIS; |
|
|
|
data.WebServer = WebServer.IIS; |
|
|
|
|
|
|
|
data.Port = string.Empty; |
|
|
|
|
|
|
|
bool isIISInstalled = WebProjectService.IISVersion == IISVersion.IIS5 || |
|
|
|
|
|
|
|
WebProjectService.IISVersion == IISVersion.IIS6 || |
|
|
|
|
|
|
|
WebProjectService.IISVersion == IISVersion.IIS7; |
|
|
|
|
|
|
|
|
|
|
|
if (!WebProjectService.IsIISInstalled) { |
|
|
|
if (!isIISInstalled) { |
|
|
|
StatusLabel.Text = ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.IISNotFound"); |
|
|
|
StatusLabel.Text = ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.IISNotFound"); |
|
|
|
ProjectUrl.Text = string.Empty; |
|
|
|
ProjectUrl.Text = string.Empty; |
|
|
|
data.WebServer = WebServer.None; |
|
|
|
data.WebServer = WebServer.None; |
|
|
|
|
|
|
|
UseLocalIIS.IsChecked = false; |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
StatusLabel.Text = string.Empty; |
|
|
|
StatusLabel.Text = string.Empty; |
|
|
@ -109,15 +138,8 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
data.ProjectUrl = ProjectUrl.Text; |
|
|
|
data.ProjectUrl = ProjectUrl.Text; |
|
|
|
CreateVirtualDirectoryButton.IsEnabled = WebProjectService.IsIISInstalled; |
|
|
|
LocalIISGroup.IsEnabled = CreateVirtualDirectoryButton.IsEnabled = isIISInstalled; |
|
|
|
ProjectUrl.IsEnabled = WebProjectService.IsIISInstalled; |
|
|
|
IISExpressGroup.IsEnabled = false; |
|
|
|
|
|
|
|
|
|
|
|
if (ProjectService.CurrentProject is CompilableProject) { |
|
|
|
|
|
|
|
((CompilableProject)ProjectService.CurrentProject).StartAction = StartAction.Project; |
|
|
|
|
|
|
|
parentPanel.SetStartAction(StartAction.Project); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LocalIISGroup.IsEnabled = true; |
|
|
|
|
|
|
|
CurrentProjectDebugData = data; |
|
|
|
CurrentProjectDebugData = data; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -128,5 +150,37 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels |
|
|
|
data.ProjectUrl = ProjectUrl.Text; |
|
|
|
data.ProjectUrl = ProjectUrl.Text; |
|
|
|
CurrentProjectDebugData = data; |
|
|
|
CurrentProjectDebugData = data; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ClearWebServerButton_Click(object sender, RoutedEventArgs e) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
UseIISExpress.IsChecked = false; |
|
|
|
|
|
|
|
UseLocalIIS.IsChecked = false; |
|
|
|
|
|
|
|
CreateVirtualDirectoryButton.IsEnabled = false; |
|
|
|
|
|
|
|
ProjectUrl.Text = string.Empty; |
|
|
|
|
|
|
|
LocalIISGroup.IsEnabled = false; |
|
|
|
|
|
|
|
IISExpressGroup.IsEnabled = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WebProjectDebugData data = new WebProjectDebugData(); |
|
|
|
|
|
|
|
data.WebServer = WebServer.None; |
|
|
|
|
|
|
|
data.ProjectUrl = string.Empty; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CurrentProjectDebugData = data; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool AreAllValidNumericChars(string str) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
foreach(char c in str) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if(!Char.IsNumber(c)) return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void PortTextBox_PreviewTextInput(object sender, System.Windows.Input.TextCompositionEventArgs e) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
e.Handled = !AreAllValidNumericChars(e.Text); |
|
|
|
|
|
|
|
base.OnPreviewTextInput(e); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |