Browse Source

Merge remote branch 'eusebiu/PropertiesWebPage'

pull/15/head
Eusebiu Marcu 15 years ago
parent
commit
ddb292a154
  1. 451
      data/resources/StringResources.resx
  2. 2
      src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj
  3. 60
      src/AddIns/Debugger/Debugger.AddIn/Service/ProcessMonitor.cs
  4. 134
      src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs
  5. 10
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  6. 46
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/DebugOptions.cs
  7. 71
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/WebProjectOptions/WebProjectOptions.cs
  8. 81
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/WebProjectOptions/WebProjectOptionsPanel.xaml
  9. 207
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/WebProjectOptions/WebProjectOptionsPanel.xaml.cs
  10. 17
      src/Main/Base/Project/Src/Project/AbstractProject.cs
  11. 15
      src/Main/Base/Project/Src/Project/CompilableProject.cs
  12. 257
      src/Main/Base/Project/Src/Services/WebProjectService/WebProjectService.cs
  13. 2
      src/Main/Core/Project/ICSharpCode.Core.csproj
  14. 58
      src/Main/Core/Project/Src/Services/RegistryService/RegistryService.cs

451
data/resources/StringResources.resx

File diff suppressed because it is too large Load Diff

2
src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj

@ -86,6 +86,7 @@
</Reference> </Reference>
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Management" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Xaml" /> <Reference Include="System.Xaml" />
@ -181,6 +182,7 @@
<DependentUpon>EditBreakpointScriptWindow.xaml</DependentUpon> <DependentUpon>EditBreakpointScriptWindow.xaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="Service\ProcessMonitor.cs" />
<Compile Include="Tooltips\DebuggerPopup.cs" /> <Compile Include="Tooltips\DebuggerPopup.cs" />
<Compile Include="Tooltips\DebuggerTooltipControl.xaml.cs"> <Compile Include="Tooltips\DebuggerTooltipControl.xaml.cs">
<DependentUpon>DebuggerTooltipControl.xaml</DependentUpon> <DependentUpon>DebuggerTooltipControl.xaml</DependentUpon>

60
src/AddIns/Debugger/Debugger.AddIn/Service/ProcessMonitor.cs

@ -0,0 +1,60 @@
// 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.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Management;
namespace ICSharpCode.SharpDevelop.Services
{
public class ProcessMonitor : ManagementEventWatcher, IDisposable
{
// Process Events
public event EventHandler ProcessCreated;
public event EventHandler ProcessDeleted;
public event EventHandler ProcessModified;
// WMI WQL process query strings
static readonly string WMI_OPER_EVENT_QUERY = @"SELECT * FROM __InstanceOperationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_Process'";
static readonly string WMI_OPER_EVENT_QUERY_WITH_PROC = WMI_OPER_EVENT_QUERY + " and TargetInstance.Name LIKE '%{0}%'";
public ProcessMonitor(string processName)
{
this.Query.QueryLanguage = "WQL";
if (string.IsNullOrEmpty(processName))
{
this.Query.QueryString = WMI_OPER_EVENT_QUERY;
}
else
{
this.Query.QueryString =
string.Format(WMI_OPER_EVENT_QUERY_WITH_PROC, processName);
}
this.EventArrived += new EventArrivedEventHandler(OnEventArrived);
}
private void OnEventArrived(object sender, EventArrivedEventArgs e)
{
string eventType = e.NewEvent.ClassPath.ClassName;
switch (eventType)
{
case "__InstanceCreationEvent":
if (ProcessCreated != null)
ProcessCreated(this, EventArgs.Empty);
break;
case "__InstanceDeletionEvent":
if (ProcessDeleted != null)
ProcessDeleted(this, EventArgs.Empty);
break;
case "__InstanceModificationEvent":
if (ProcessModified != null)
ProcessModified(this, EventArgs.Empty);
break;
}
}
}
}

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

@ -14,7 +14,6 @@ using System.Windows.Forms;
using Debugger; using Debugger;
using Debugger.AddIn.Tooltips; using Debugger.AddIn.Tooltips;
using Debugger.AddIn.TreeModel; using Debugger.AddIn.TreeModel;
using Debugger.Interop;
using Debugger.Interop.CorPublish; using Debugger.Interop.CorPublish;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.Core.WinForms; using ICSharpCode.Core.WinForms;
@ -24,6 +23,7 @@ using ICSharpCode.NRefactory.Visitors;
using ICSharpCode.SharpDevelop.Bookmarks; using ICSharpCode.SharpDevelop.Bookmarks;
using ICSharpCode.SharpDevelop.Debugging; using ICSharpCode.SharpDevelop.Debugging;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Gui.OptionPanels;
using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Project;
using Process = Debugger.Process; using Process = Debugger.Process;
@ -45,6 +45,7 @@ namespace ICSharpCode.SharpDevelop.Services
ICorPublish corPublish; ICorPublish corPublish;
Process debuggedProcess; Process debuggedProcess;
ProcessMonitor monitor;
//DynamicTreeDebuggerRow currentTooltipRow; //DynamicTreeDebuggerRow currentTooltipRow;
//Expression currentTooltipExpression; //Expression currentTooltipExpression;
@ -138,7 +139,56 @@ namespace ICSharpCode.SharpDevelop.Services
if (!ServiceInitialized) { if (!ServiceInitialized) {
InitializeService(); InitializeService();
} }
if (FileUtility.IsUrl(processStartInfo.FileName)) {
var project = ProjectService.OpenSolution.Preferences.StartupProject as CompilableProject;
var options = WebProjectsOptions.Instance.GetWebProjectOptions(project.Name);
if (!CheckWebProjectStartInfo(project, options))
return;
System.Diagnostics.Process defaultAppProcess = null;
if (options.Data.WebServer != WebServer.None) {
string processName = WebProjectService.WorkerProcessName;
// try find the worker process directly or using the process monitor callback
var processes = System.Diagnostics.Process.GetProcesses();
int index = processes.FindIndex(p => p.ProcessName.Equals(processName, StringComparison.OrdinalIgnoreCase));
if (index > -1){
Attach(processes[index]);
} else {
this.monitor = new ProcessMonitor(processName);
this.monitor.ProcessCreated += delegate {
WorkbenchSingleton.SafeThreadCall((Action)(() => OnProcessCreated(defaultAppProcess, options)));
};
this.monitor.Start();
}
if (options.Data.WebServer == WebServer.IISExpress) {
// start IIS express and attach to it
if (WebProjectService.IISVersion == IISVersion.IISExpress)
System.Diagnostics.Process.Start(WebProjectService.IIISExpressProcessLocation);
else {
MessageService.ShowError("${res:ICSharpCode.WepProjectOptionsPanel.NoProjectUrlOrProgramAction}");
return;
}
}
}
// start default application(e.g. browser)
if (project.StartAction == StartAction.StartURL)
defaultAppProcess = System.Diagnostics.Process.Start(project.StartUrl);
else {
if (!string.IsNullOrEmpty(options.Data.ProjectUrl) && options.Data.WebServer == WebServer.IIS)
defaultAppProcess = System.Diagnostics.Process.Start(options.Data.ProjectUrl);
else {
if (options.Data.WebServer == WebServer.IISExpress)
defaultAppProcess = System.Diagnostics.Process.Start(options.Data.ProjectUrl);
}
}
}
else {
string version = debugger.GetProgramVersion(processStartInfo.FileName); string version = debugger.GetProgramVersion(processStartInfo.FileName);
if (version.StartsWith("v1.0")) { if (version.StartsWith("v1.0")) {
MessageService.ShowMessage("${res:XML.MainMenu.DebugMenu.Error.Net10NotSupported}"); MessageService.ShowMessage("${res:XML.MainMenu.DebugMenu.Error.Net10NotSupported}");
} else if (version.StartsWith("v1.1")) { } else if (version.StartsWith("v1.1")) {
@ -183,6 +233,7 @@ namespace ICSharpCode.SharpDevelop.Services
} }
} }
} }
}
public void ShowAttachDialog() public void ShowAttachDialog()
{ {
@ -195,6 +246,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;
@ -238,6 +292,41 @@ namespace ICSharpCode.SharpDevelop.Services
public void StartWithoutDebugging(ProcessStartInfo processStartInfo) public void StartWithoutDebugging(ProcessStartInfo processStartInfo)
{ {
if (FileUtility.IsUrl(processStartInfo.FileName)) {
var project = ProjectService.OpenSolution.Preferences.StartupProject as CompilableProject;
var options = WebProjectsOptions.Instance.GetWebProjectOptions(project.Name);
if (!CheckWebProjectStartInfo(project, options))
return;
if (options.Data.WebServer != WebServer.None) {
string processName = WebProjectService.WorkerProcessName;
if (options.Data.WebServer == WebServer.IISExpress) {
// start IIS express
if (WebProjectService.IISVersion == IISVersion.IISExpress)
System.Diagnostics.Process.Start(WebProjectService.IIISExpressProcessLocation);
else {
MessageService.ShowError("${res:ICSharpCode.WepProjectOptionsPanel.NoProjectUrlOrProgramAction}");
return;
}
}
}
// start default application(e.g. browser)
if (project.StartAction == StartAction.StartURL)
System.Diagnostics.Process.Start(project.StartUrl);
else {
if (!string.IsNullOrEmpty(options.Data.ProjectUrl) && options.Data.WebServer == WebServer.IIS)
System.Diagnostics.Process.Start(options.Data.ProjectUrl);
else {
if (!string.IsNullOrEmpty(options.Data.ProjectUrl) && options.Data.WebServer == WebServer.IISExpress)
System.Diagnostics.Process.Start(options.Data.ProjectUrl);
else
System.Diagnostics.Process.Start(processStartInfo.FileName);
}
}
}
else
System.Diagnostics.Process.Start(processStartInfo); System.Diagnostics.Process.Start(processStartInfo);
} }
@ -262,6 +351,49 @@ namespace ICSharpCode.SharpDevelop.Services
} else { } else {
debuggedProcess.Terminate(); debuggedProcess.Terminate();
} }
if (monitor != null) {
monitor.Stop();
monitor.Dispose();
monitor = null;
}
}
bool CheckWebProjectStartInfo(CompilableProject project, WebProjectOptions options)
{
if (project == null) {
MessageService.ShowError("${res:ICSharpCode.WepProjectOptionsPanel.NoStartupProject}");
return false;
}
if (options == null || options.Data == null) {
MessageService.ShowError("${res:ICSharpCode.WepProjectOptionsPanel.NoProjectUrlOrProgramAction}");
return false;
}
return true;
}
void OnProcessCreated(System.Diagnostics.Process defaultAppProcess, WebProjectOptions debugData)
{
if (attached)
return;
string processName = WebProjectService.WorkerProcessName;
var processes = System.Diagnostics.Process.GetProcesses();
int index = processes.FindIndex(p => p.ProcessName.Equals(processName, StringComparison.OrdinalIgnoreCase));
Attach(processes[index]);
if (!attached) {
if(debugData.Data.WebServer == WebServer.IIS) {
string format = ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.NoIISWP");
MessageService.ShowMessage(string.Format(format, processName));
} else {
Attach(defaultAppProcess);
if (!attached) {
MessageService.ShowMessage(ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.UnableToAttach"));
}
}
}
} }
// ExecutionControl: // ExecutionControl:

10
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -44,6 +44,7 @@
<DefineConstants>TRACE;PUBLICINTERPROCESS</DefineConstants> <DefineConstants>TRACE;PUBLICINTERPROCESS</DefineConstants>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Mono.Cecil"> <Reference Include="Mono.Cecil">
<HintPath>..\..\..\Libraries\Mono.Cecil\Mono.Cecil.dll</HintPath> <HintPath>..\..\..\Libraries\Mono.Cecil\Mono.Cecil.dll</HintPath>
<Private>False</Private> <Private>False</Private>
@ -62,6 +63,7 @@
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Design" /> <Reference Include="System.Design" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Web.Services" /> <Reference Include="System.Web.Services" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
@ -245,6 +247,10 @@
<DependentUpon>SelectCulturePanel.xaml</DependentUpon> <DependentUpon>SelectCulturePanel.xaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\WebProjectOptions\WebProjectOptions.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\WebProjectOptions\WebProjectOptionsPanel.xaml.cs">
<DependentUpon>WebProjectOptionsPanel.xaml</DependentUpon>
</Compile>
<Compile Include="Src\Gui\Dialogs\ToolNotFoundDialog.cs" /> <Compile Include="Src\Gui\Dialogs\ToolNotFoundDialog.cs" />
<Compile Include="Src\Gui\Dialogs\ToolNotFoundDialog.Designer.cs"> <Compile Include="Src\Gui\Dialogs\ToolNotFoundDialog.Designer.cs">
<DependentUpon>ToolNotFoundDialog.cs</DependentUpon> <DependentUpon>ToolNotFoundDialog.cs</DependentUpon>
@ -731,6 +737,7 @@
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\AsyncDiscoveryState.cs" /> <Compile Include="Src\Gui\Dialogs\ReferenceDialog\AsyncDiscoveryState.cs" />
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\DiscoveryNetworkCredential.cs" /> <Compile Include="Src\Gui\Dialogs\ReferenceDialog\DiscoveryNetworkCredential.cs" />
<Compile Include="Src\Services\ProjectService\ProjectLoader.cs" /> <Compile Include="Src\Services\ProjectService\ProjectLoader.cs" />
<Compile Include="Src\Services\WebProjectService\WebProjectService.cs" />
<Compile Include="Src\Util\FakeXmlViewContent.cs" /> <Compile Include="Src\Util\FakeXmlViewContent.cs" />
<Compile Include="Src\Util\TreeNode.cs" /> <Compile Include="Src\Util\TreeNode.cs" />
<Compile Include="Src\Util\NativeMethods.cs" /> <Compile Include="Src\Util\NativeMethods.cs" />
@ -812,6 +819,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="Src\Bookmarks\Pad\Controls\ListViewPad.xaml" /> <Page Include="Src\Bookmarks\Pad\Controls\ListViewPad.xaml" />
<Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\WebProjectOptions\WebProjectOptionsPanel.xaml" />
<Page Include="Src\Services\RefactoringService\ContextActions\ContextActionsBulbControl.xaml" /> <Page Include="Src\Services\RefactoringService\ContextActions\ContextActionsBulbControl.xaml" />
<Page Include="Src\Services\RefactoringService\ContextActions\ContextActionsControl.xaml" /> <Page Include="Src\Services\RefactoringService\ContextActions\ContextActionsControl.xaml" />
<Page Include="Src\Services\RefactoringService\ContextActions\ContextActionsHeaderedControl.xaml" /> <Page Include="Src\Services\RefactoringService\ContextActions\ContextActionsHeaderedControl.xaml" />
@ -840,9 +848,11 @@
<Folder Include="Src\Editor\CodeCompletion" /> <Folder Include="Src\Editor\CodeCompletion" />
<Folder Include="Src\Editor\Commands" /> <Folder Include="Src\Editor\Commands" />
<Folder Include="Src\Editor\Search" /> <Folder Include="Src\Editor\Search" />
<Folder Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\WebProjectOptions" />
<Folder Include="Src\Gui\Pads\TaskList" /> <Folder Include="Src\Gui\Pads\TaskList" />
<Folder Include="Src\Services\Debugger\Tooltips" /> <Folder Include="Src\Services\Debugger\Tooltips" />
<Folder Include="Src\Services\RefactoringService\ContextActions" /> <Folder Include="Src\Services\RefactoringService\ContextActions" />
<Folder Include="Src\Services\WebProjectService" />
<Folder Include="Src\Util" /> <Folder Include="Src\Util" />
<Folder Include="Src\Gui\Pads\ClassBrowser\NodeBuilder" /> <Folder Include="Src\Gui\Pads\ClassBrowser\NodeBuilder" />
<Folder Include="Src\Services\NavigationService" /> <Folder Include="Src\Services\NavigationService" />

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

@ -2,7 +2,11 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System; using System;
using System.Windows;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Forms.Integration;
using System.Windows.Media;
using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Project;
using RadioBinding = System.Collections.Generic.KeyValuePair<ICSharpCode.SharpDevelop.Project.StartAction, System.Windows.Forms.RadioButton>; using RadioBinding = System.Collections.Generic.KeyValuePair<ICSharpCode.SharpDevelop.Project.StartAction, System.Windows.Forms.RadioButton>;
@ -50,6 +54,21 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
UpdateEnabledStates(this, EventArgs.Empty); UpdateEnabledStates(this, EventArgs.Empty);
helper.AddConfigurationSelector(this); helper.AddConfigurationSelector(this);
// add server for web projects
if (ProjectService.CurrentProject is CompilableProject) {
bool isWebProject = ((CompilableProject)ProjectService.CurrentProject).IsWebProject;
if (isWebProject) {
ElementHost host = new ElementHost();
host.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
host.Height = 175;
host.Width = 550;
host.Top = 240;
host.Left = 8;
host.Child = new WebProjectOptionsPanel(this);
Controls.Add(host);
}
}
} }
void UpdateEnabledStates(object sender, EventArgs e) void UpdateEnabledStates(object sender, EventArgs e)
@ -57,5 +76,32 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
Get<TextBox>("startExternalProgram").Enabled = Get<Button>("startExternalProgramBrowse").Enabled = Get<RadioButton>("startExternalProgram").Checked; Get<TextBox>("startExternalProgram").Enabled = Get<Button>("startExternalProgramBrowse").Enabled = Get<RadioButton>("startExternalProgram").Checked;
Get<TextBox>("startBrowserInURL").Enabled = Get<RadioButton>("startBrowserInURL").Checked; Get<TextBox>("startBrowserInURL").Enabled = Get<RadioButton>("startBrowserInURL").Checked;
} }
public void SetStartAction(StartAction action)
{
switch(action) {
case StartAction.Project:
Get<RadioButton>("startProject").Checked = true;
break;
case StartAction.Program:
Get<RadioButton>("startExternalProgram").Checked = true;
break;
case StartAction.StartURL:
Get<RadioButton>("startBrowserInURL").Checked = true;
break;
default:
throw new NotSupportedException("Unknown action!");
}
UpdateEnabledStates(null, EventArgs.Empty);
}
public void SetExternalProgram(string externalProgram)
{
if (externalProgram == null)
return;
Get<TextBox>("startExternalProgram").Text = externalProgram;
}
} }
} }

71
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/WebProjectOptions/WebProjectOptions.cs

@ -0,0 +1,71 @@
// 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.Collections.Generic;
using System.ComponentModel;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
{
public sealed class WebProjectsOptions
{
private WebProjectsOptions() { }
private static readonly WebProjectsOptions _Instance = new WebProjectsOptions();
private List<WebProjectOptions> options = new List<WebProjectOptions>();
public WebProjectOptions GetWebProjectOptions(string projectName) {
return options.Find(o => o.ProjectName == projectName);
}
public void SetWebProjectOptions(string projectName, WebProjectOptions data)
{
var d = GetWebProjectOptions(projectName);
if (d == null)
{
if (data == null)
data = new WebProjectOptions() { ProjectName = projectName };
options.Add(data);
}
else
{
int index = options.IndexOf(d);
options[index] = data;
}
}
public static WebProjectsOptions Instance {
get {
return _Instance;
}
}
}
[Serializable]
public class WebProjectOptions
{
[DefaultValue(null)]
public string ProjectName { get; set; }
[DefaultValue(null)]
public WebProjectDebugData Data { get; set; }
}
[Serializable]
public class WebProjectDebugData
{
[DefaultValue(null)]
public string ProjectUrl { get; set; }
[DefaultValue("8080")]
public string Port { get; set; }
[DefaultValue(WebServer.None)]
public WebServer WebServer { get; set; }
}
}

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

@ -0,0 +1,81 @@
<?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"
>
<GroupBox Margin="0, 0, 85, 0"
Header="{core:Localize ICSharpCode.WepProjectOptionsPanel.Server}">
<widgets:StackPanelWithSpacing SpaceBetweenItems="3">
<!--IIS Express-->
<widgets:StackPanelWithSpacing SpaceBetweenItems="3">
<RadioButton
IsChecked="False"
GroupName="WebProject"
x:Name="UseIISExpress"
Click="UseIISExpress_Click"
Content="{core:Localize ICSharpCode.WepProjectOptionsPanel.UseIISExpress}" />
<Grid Margin="10, 3"
IsEnabled="False"
x:Name="IISExpressGroup"
VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{core:Localize ICSharpCode.WepProjectOptionsPanel.Port}"/>
<TextBox Grid.Column="1" x:Name="PortTextBox"
PreviewTextInput="PortTextBox_PreviewTextInput" Text="8080"
KeyUp="PortTextBox_KeyUp" />
</Grid>
</widgets:StackPanelWithSpacing>
<!--IIS Local Server-->
<widgets:StackPanelWithSpacing SpaceBetweenItems="3">
<RadioButton
IsChecked="False"
GroupName="WebProject"
x:Name="UseLocalIIS"
Click="UseLocalIIS_Click"
Content="{core:Localize ICSharpCode.WepProjectOptionsPanel.UseLocalIIS}" />
<Grid Margin="10, 3"
IsEnabled="False"
x:Name="LocalIISGroup"
VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<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" />
</Grid>
</widgets:StackPanelWithSpacing>
<TextBlock
Foreground="Red"
TextDecorations="Underline"
FontSize="12"
FontWeight="Bold"
TextWrapping="Wrap"
Name="StatusLabel" />
<widgets:UniformGridWithSpacing Columns="2" SpaceBetweenColumns="10">
<Button
IsEnabled="False"
Style="{x:Static core:GlobalStyles.ButtonStyle}"
Name="CreateVirtualDirectoryButton"
Content="{core:Localize ICSharpCode.WepProjectOptionsPanel.CreateVirtualDir}"
Click="CreateVirtualDirectory_Click" />
<Button
Style="{x:Static core:GlobalStyles.ButtonStyle}"
Name="ClearWebServerButton"
Content="{core:Localize ICSharpCode.WepProjectOptionsPanel.DisableWebServerButton}"
Click="ClearWebServerButton_Click" />
</widgets:UniformGridWithSpacing>
</widgets:StackPanelWithSpacing>
</GroupBox>
</UserControl>

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

@ -0,0 +1,207 @@
// 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.Web.Services.Description;
using System.Windows;
using System.Windows.Controls;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
{
public partial class WebProjectOptionsPanel : UserControl
{
private readonly DebugOptions parentPanel;
public WebProjectOptionsPanel(DebugOptions parentPanel)
{
InitializeComponent();
this.parentPanel = parentPanel;
if (CurrentProjectDebugData == null)
CurrentProjectDebugData = new WebProjectDebugData();
Loaded += OnLoaded;
}
void OnLoaded(object sender, RoutedEventArgs e)
{
if (!WebProjectService.IsIISInstalled) {
StatusLabel.Text = ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.IISNotFound");
return;
}
switch (CurrentProjectDebugData.WebServer)
{
case WebServer.IISExpress:
if (WebProjectService.IISVersion == IISVersion.IISExpress) {
UseIISExpress.IsChecked = true;
PortTextBox.Text = CurrentProjectDebugData.Port ?? "8080";
SelectIISExpress();
}
break;
case WebServer.IIS:
if (WebProjectService.IISVersion == IISVersion.IIS5 ||
WebProjectService.IISVersion == IISVersion.IIS6 ||
WebProjectService.IISVersion == IISVersion.IIS7 ||
WebProjectService.IISVersion == IISVersion.IIS_Future) {
UseLocalIIS.IsChecked = true;
ProjectUrl.Text = CurrentProjectDebugData.ProjectUrl ?? string.Empty;
SelectLocalIIS();
}
break;
default:
// do nothing
break;
}
}
WebProjectDebugData CurrentProjectDebugData {
get {
var data = WebProjectsOptions.Instance.GetWebProjectOptions(ProjectService.CurrentProject.Name);
if (data != null)
return data.Data;
return null;
}
set {
WebProjectOptions data;
if (value != null)
{
data = new WebProjectOptions() {
ProjectName = ProjectService.CurrentProject.Name,
Data = value
};
}
else
data = new WebProjectOptions();
WebProjectsOptions.Instance.SetWebProjectOptions(ProjectService.CurrentProject.Name, data);
}
}
void CreateVirtualDirectory_Click(object sender, RoutedEventArgs e)
{
string error = WebProjectService.CreateVirtualDirectory(ProjectService.CurrentProject.Name,
Path.GetDirectoryName(ProjectService.CurrentProject.FileName));
if (!string.IsNullOrEmpty(error))
MessageService.ShowError(error);
else {
MessageService.ShowMessage(ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.VirtualDirCreated"));
}
}
void UseIISExpress_Click(object sender, RoutedEventArgs e)
{
SelectIISExpress();
}
void SelectIISExpress()
{
WebProjectDebugData data = new WebProjectDebugData();
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 (!isIISExpressInstalled) {
UseIISExpress.IsChecked = false;
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;
CurrentProjectDebugData = data;
}
void UseLocalIIS_Click(object sender, RoutedEventArgs e)
{
SelectLocalIIS();
}
void SelectLocalIIS()
{
WebProjectDebugData data = new WebProjectDebugData();
data.WebServer = WebServer.IIS;
data.Port = string.Empty;
bool isIISInstalled = WebProjectService.IISVersion == IISVersion.IIS5 ||
WebProjectService.IISVersion == IISVersion.IIS6 ||
WebProjectService.IISVersion == IISVersion.IIS7;
if (!isIISInstalled) {
StatusLabel.Text = ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.IISNotFound");
ProjectUrl.Text = string.Empty;
data.WebServer = WebServer.None;
UseLocalIIS.IsChecked = false;
}
else {
StatusLabel.Text = string.Empty;
ProjectUrl.Text = @"http://localhost/" + ProjectService.CurrentProject.Name;
}
data.ProjectUrl = ProjectUrl.Text;
LocalIISGroup.IsEnabled = CreateVirtualDirectoryButton.IsEnabled = isIISInstalled;
IISExpressGroup.IsEnabled = false;
CurrentProjectDebugData = data;
}
void ProjectUrl_TextChanged(object sender, TextChangedEventArgs e)
{
WebProjectDebugData data = new WebProjectDebugData();
data.WebServer = WebServer.IIS;
data.ProjectUrl = ProjectUrl.Text;
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);
}
void PortTextBox_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
{
WebProjectDebugData data = new WebProjectDebugData();
data.WebServer = WebServer.IISExpress;
data.Port = PortTextBox.Text;
data.ProjectUrl = string.Format(@"http://localhost:{0}/" + ProjectService.CurrentProject.Name, PortTextBox.Text);
CurrentProjectDebugData = data;
}
}
}

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

@ -11,6 +11,7 @@ using System.IO;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Debugging; using ICSharpCode.SharpDevelop.Debugging;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Gui.OptionPanels;
namespace ICSharpCode.SharpDevelop.Project namespace ICSharpCode.SharpDevelop.Project
{ {
@ -78,6 +79,11 @@ namespace ICSharpCode.SharpDevelop.Project
} }
} }
properties.Set("files", files.ToArray()); properties.Set("files", files.ToArray());
var webOptions = WebProjectsOptions.Instance.GetWebProjectOptions(Name);
if (webOptions != null)
properties.Set("WebProjectOptions", webOptions);
return properties; return properties;
} }
@ -91,6 +97,8 @@ namespace ICSharpCode.SharpDevelop.Project
foreach (string fileName in memento.Get("files", new string[0])) { foreach (string fileName in memento.Get("files", new string[0])) {
filesToOpenAfterSolutionLoad.Add(fileName); filesToOpenAfterSolutionLoad.Add(fileName);
} }
WebProjectsOptions.Instance.SetWebProjectOptions(Name, memento.Get("WebProjectOptions", new WebProjectOptions()) as WebProjectOptions);
} }
#endregion #endregion
@ -358,6 +366,13 @@ namespace ICSharpCode.SharpDevelop.Project
} }
} }
[Browsable(false)]
public virtual bool IsWebProject {
get {
return false;
}
}
public virtual void Start(bool withDebugging) public virtual void Start(bool withDebugging)
{ {
ProcessStartInfo psi; ProcessStartInfo psi;
@ -367,7 +382,7 @@ namespace ICSharpCode.SharpDevelop.Project
MessageService.ShowError(ex.Message); MessageService.ShowError(ex.Message);
return; return;
} }
if (withDebugging && !FileUtility.IsUrl(psi.FileName)) { if (withDebugging) {
DebuggerService.CurrentDebugger.Start(psi); DebuggerService.CurrentDebugger.Start(psi);
} else { } else {
DebuggerService.CurrentDebugger.StartWithoutDebugging(psi); DebuggerService.CurrentDebugger.StartWithoutDebugging(psi);

15
src/Main/Base/Project/Src/Project/CompilableProject.cs

@ -217,6 +217,9 @@ namespace ICSharpCode.SharpDevelop.Project
if (IsSilverlightProject) { if (IsSilverlightProject) {
return TestPageFileName.Length > 0; return TestPageFileName.Length > 0;
} }
if (IsWebProject)
return true;
switch (this.StartAction) { switch (this.StartAction) {
case StartAction.Project: case StartAction.Project:
return OutputType == OutputType.Exe || OutputType == OutputType.WinExe; return OutputType == OutputType.Exe || OutputType == OutputType.WinExe;
@ -279,8 +282,12 @@ namespace ICSharpCode.SharpDevelop.Project
string pagePath = "file:///" + Path.Combine(OutputFullPath, TestPageFileName); string pagePath = "file:///" + Path.Combine(OutputFullPath, TestPageFileName);
return new ProcessStartInfo(pagePath); return new ProcessStartInfo(pagePath);
} }
switch (this.StartAction) { switch (this.StartAction) {
case StartAction.Project: case StartAction.Project:
if (IsWebProject)
return new ProcessStartInfo("http://localhost");
return CreateStartInfo(this.OutputAssemblyFullPath); return CreateStartInfo(this.OutputAssemblyFullPath);
case StartAction.Program: case StartAction.Program:
return CreateStartInfo(this.StartProgram); return CreateStartInfo(this.StartProgram);
@ -356,6 +363,14 @@ namespace ICSharpCode.SharpDevelop.Project
} }
} }
[Browsable(false)]
public override bool IsWebProject {
get {
string guids = GetEvaluatedProperty("ProjectTypeGuids") ?? "";
return guids.Contains("349c5851-65df-11da-9384-00065b846f21");
}
}
[Browsable(false)] [Browsable(false)]
public string TestPageFileName { public string TestPageFileName {
get { get {

257
src/Main/Base/Project/Src/Services/WebProjectService/WebProjectService.cs

@ -0,0 +1,257 @@
// 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.EnterpriseServices.Internal;
using System.IO;
using System.Reflection;
using ICSharpCode.Core;
using Microsoft.Win32;
namespace ICSharpCode.SharpDevelop.Project
{
public enum IISVersion
{
None = 0,
IIS5 = 5,
IIS6,
IIS7,
IISExpress,
IIS_Future
}
public enum WebServer
{
None,
IISExpress,
IIS
}
/// <summary>
/// Exposes common operations used in Web Projects
/// </summary>
public static class WebProjectService
{
const string IIS_LOCATION = "Software\\Microsoft\\InetStp";
const string IIS_MAJOR_VERSION = "MajorVersion";
const string IIS_INSTALL_PATH = "InstallPath";
const string DEFAULT_WEB_SITE = "Default Web Site";
const string IIS_WEB_LOCATION = "IIS://localhost/W3SVC/1/Root";
const string ASPNET_REG_PATH = @"SOFTWARE\MICROSOFT\ASP.NET";
const string ASPNET_ROOT_VER = @"RootVer";
const string FRAMEWORK_LOCATION = @"%systemroot%\Microsoft.NET\";
const string FRAMEWORK32 = @"Framework\";
const string FRAMEWORK64 = @"Framework64\";
/// <summary>
/// Gets &quot;iisexpress&quot; string.
/// </summary>
public const string IIS_EXPRESS_PROCESS_NAME = "iisexpress";
/// <summary>
/// Gets &quot;aspnet_wp&quot; string.
/// </summary>
public const string IIS_5_PROCESS_NAME = "aspnet_wp";
/// <summary>
/// Gets &quot;w3wp&quot; string.
/// </summary>
public const string IIS_NEW_PROCESS_NAME = "w3wp";
/// <summary>
/// Gets IIS Express process location.
/// </summary>
public static string IIISExpressProcessLocation {
get {
return Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFiles) +
@"\IIS Express\iisexpress.exe";
}
}
/// <summary>
/// Gets the IIS worker process name.
/// </summary>
public static string WorkerProcessName {
get {
if (!IsIISInstalled)
return ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.IISNotFound");
try {
string name;
switch(IISVersion)
{
case IISVersion.IIS5:
name = IIS_5_PROCESS_NAME;
break;
case IISVersion.IISExpress:
name = IIS_EXPRESS_PROCESS_NAME;
break;
default:
name = IIS_NEW_PROCESS_NAME;
break;
}
return name;
}
catch (Exception ex) {
return ex.Message;
}
}
}
public static string WorkerProcessLocation {
get {
if (!IsIISInstalled)
return ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.IISNotFound");
try {
string location;
switch(IISVersion)
{
case IISVersion.IIS5:
location = FRAMEWORK_LOCATION + (Environment.Is64BitOperatingSystem ? FRAMEWORK64 : FRAMEWORK32);
string frameworkString = "";
RegistryService.GetRegistryValue<string>(
RegistryHive.LocalMachine,
ASPNET_REG_PATH,
ASPNET_ROOT_VER,
RegistryValueKind.String,
out frameworkString);
int ind = frameworkString.LastIndexOf('.');
location += "v" + frameworkString.Substring(0, ind) + "\\";
break;
default:
string regValue = "";
RegistryService.GetRegistryValue<string>(
RegistryHive.LocalMachine,
IIS_LOCATION,
IIS_INSTALL_PATH,
RegistryValueKind.String,
out regValue);
location = regValue + "\\";
break;
}
return location;
}
catch (Exception ex) {
return ex.Message;
}
}
}
/// <summary>
/// Gets a value representing whether IIS is installed.
/// </summary>
public static bool IsIISInstalled {
get {
return (int)IISVersion > 4;
}
}
/// <summary>
/// Gets a value representing IIS version.
/// </summary>
public static IISVersion IISVersion
{
get {
int regValue = 0;
RegistryService.GetRegistryValue<int>(
RegistryHive.LocalMachine,
IIS_LOCATION,
IIS_MAJOR_VERSION,
RegistryValueKind.DWord,
out regValue);
if (regValue > 4)
return (IISVersion)regValue;
if (File.Exists(IIISExpressProcessLocation))
return IISVersion.IISExpress;
return IISVersion.None;
}
}
/// <summary>
/// Creates a virtual directory in local IIS or IIS Express.
/// </summary>
/// <param name="virtualDirectoryName">Virtual directory name.</param>
/// <param name="virtualDirectoryPath">Physical path.</param>
/// <returns></returns>
public static string CreateVirtualDirectory(string virtualDirectoryName, string physicalDirectoryPath)
{
try {
if (!IsIISInstalled)
return ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.IISNotFound");
string error;
switch(IISVersion)
{
case IISVersion.IIS5:
case IISVersion.IIS6:
var vr = new IISVirtualRoot();
vr.Create(IIS_WEB_LOCATION,
physicalDirectoryPath,
virtualDirectoryName,
out error);
break;
default:
// TODO: find a better way to create IIS 7 applications without Microsoft.Web.Administration.ServerManager
string name = "/" + virtualDirectoryName;
// load from GAC - IIS7 is installed
Assembly webAdministrationAssembly;
try {
// iis 7
webAdministrationAssembly = Assembly.Load("Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
}
catch {
// iis express
webAdministrationAssembly = Assembly.Load("Microsoft.Web.Administration, Version=7.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
}
// use dynamic because classic reflection is way TOO ugly
dynamic manager = webAdministrationAssembly.CreateInstance("Microsoft.Web.Administration.ServerManager");
if (manager.Sites[DEFAULT_WEB_SITE] != null) {
if (manager.Sites[DEFAULT_WEB_SITE].Applications[name] == null) {
manager.Sites[DEFAULT_WEB_SITE].Applications.Add(name, physicalDirectoryPath);
manager.CommitChanges();
error = string.Empty;
} else {
error = ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.ApplicationExists");
}
} else {
if (manager.Sites[0].Applications[name] == null) {
manager.Sites[0].Applications.Add(name, physicalDirectoryPath);
manager.CommitChanges();
error = string.Empty;
} else {
error = ResourceService.GetString("ICSharpCode.WepProjectOptionsPanel.ApplicationExists");
}
}
manager.Dispose();
break;
}
return error;
}
catch (Exception ex) {
return ex.Message;
}
}
}
}

2
src/Main/Core/Project/ICSharpCode.Core.csproj

@ -104,6 +104,7 @@
<Compile Include="Src\Services\PropertyService\Properties.cs" /> <Compile Include="Src\Services\PropertyService\Properties.cs" />
<Compile Include="Src\Services\PropertyService\PropertyChangedEvent.cs" /> <Compile Include="Src\Services\PropertyService\PropertyChangedEvent.cs" />
<Compile Include="Src\Services\PropertyService\PropertyService.cs" /> <Compile Include="Src\Services\PropertyService\PropertyService.cs" />
<Compile Include="Src\Services\RegistryService\RegistryService.cs" />
<Compile Include="Src\Services\ResourceService\ResourceNotFoundException.cs" /> <Compile Include="Src\Services\ResourceService\ResourceNotFoundException.cs" />
<Compile Include="Src\Services\ResourceService\ResourceService.cs" /> <Compile Include="Src\Services\ResourceService\ResourceService.cs" />
<Compile Include="Src\Services\ServiceManager.cs" /> <Compile Include="Src\Services\ServiceManager.cs" />
@ -132,6 +133,7 @@
<ItemGroup> <ItemGroup>
<Folder Include="Src\Services\LoggingService" /> <Folder Include="Src\Services\LoggingService" />
<Folder Include="Src\Services\AnalyticsMonitor" /> <Folder Include="Src\Services\AnalyticsMonitor" />
<Folder Include="Src\Services\RegistryService" />
<Folder Include="Src\Services\ResourceService" /> <Folder Include="Src\Services\ResourceService" />
<Content Include="..\..\..\..\data\schemas\AddIn.xsd"> <Content Include="..\..\..\..\data\schemas\AddIn.xsd">
<Link>Src\AddInTree\AddIn\AddIn.xsd</Link> <Link>Src\AddInTree\AddIn\AddIn.xsd</Link>

58
src/Main/Core/Project/Src/Services/RegistryService/RegistryService.cs

@ -0,0 +1,58 @@
// 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.Globalization;
using Microsoft.Win32;
namespace ICSharpCode.Core
{
/// <summary>
/// RegistryService.
/// </summary>
public static class RegistryService
{
/// <summary>
/// Gets the registry value.
/// </summary>
/// <param name="hive">Registry hive.</param>
/// <param name="key">Registry key.</param>
/// <param name="value">Registry value.</param>
/// <param name="kind">Registry kind.</param>
/// <param name="data">Data.</param>
/// <returns>True, if the data was found, False otherwise.</returns>
public static bool GetRegistryValue<T>(RegistryHive hive, string key, string value, RegistryValueKind kind, out T data)
{
data = default(T);
try {
using (RegistryKey baseKey = RegistryKey.OpenRemoteBaseKey(hive, String.Empty))
{
if (baseKey != null)
{
using (RegistryKey registryKey = baseKey.OpenSubKey(key, RegistryKeyPermissionCheck.ReadSubTree))
{
if (registryKey != null)
{
RegistryValueKind kindFound = registryKey.GetValueKind(value);
if (kindFound == kind)
{
object regValue = registryKey.GetValue(value, null);
if (regValue != null)
{
data = (T)Convert.ChangeType(regValue, typeof(T), CultureInfo.InvariantCulture);
return true;
}
}
}
}
}
}
return false;
} catch {
return false;
}
}
}
}
Loading…
Cancel
Save