Browse Source

Fixed SD2-1045: Opening a solution created in SharpDevelop in VS Express shows security warnings

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1878 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
de9026a99e
  1. 17
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs
  2. 3
      src/Main/Base/Project/Src/Project/ConfigurationGuiBinding.cs
  3. 22
      src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs
  4. 4
      src/Main/Base/Project/Src/Project/MSBuildProject.cs

17
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs

@ -24,13 +24,26 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -24,13 +24,26 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
{
protected void InitBaseIntermediateOutputPath()
{
helper.BindString("baseIntermediateOutputPathTextBox", "BaseIntermediateOutputPath").CreateLocationButton("baseIntermediateOutputPathTextBox");
helper.BindString(Get<TextBox>("baseIntermediateOutputPath"),
"BaseIntermediateOutputPath",
delegate { return @"obj\"; }
).CreateLocationButton("baseIntermediateOutputPathTextBox");
ConnectBrowseFolder("baseIntermediateOutputPathBrowseButton", "baseIntermediateOutputPathTextBox", "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}");
}
protected void InitIntermediateOutputPath()
{
helper.BindString("intermediateOutputPathTextBox", "IntermediateOutputPath").CreateLocationButton("intermediateOutputPathTextBox");
ConfigurationGuiBinding binding = helper.BindString(
Get<TextBox>("intermediateOutputPath"),
"IntermediateOutputPath",
delegate {
PropertyStorageLocations l;
return Path.Combine(helper.GetProperty("BaseIntermediateOutputPath", @"obj\", out l),
helper.Configuration);
}
);
binding.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
binding.CreateLocationButton("intermediateOutputPathTextBox");
ConnectBrowseFolder("intermediateOutputPathBrowseButton", "intermediateOutputPathTextBox", "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}");
}

3
src/Main/Base/Project/Src/Project/ConfigurationGuiBinding.cs

@ -156,6 +156,9 @@ namespace ICSharpCode.SharpDevelop.Project @@ -156,6 +156,9 @@ namespace ICSharpCode.SharpDevelop.Project
public void Set<T>(T value)
{
if (location == PropertyStorageLocations.Unknown) {
location = defaultLocation;
}
helper.SetProperty(property, value, location);
}

22
src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs

@ -206,15 +206,22 @@ namespace ICSharpCode.SharpDevelop.Project @@ -206,15 +206,22 @@ namespace ICSharpCode.SharpDevelop.Project
#endregion
#region Bind string to TextBox or ComboBox
static Func<string> GetEmptyString = delegate { return ""; };
public ConfigurationGuiBinding BindString(string control, string property)
{
return BindString(controlDictionary[control], property);
return BindString(controlDictionary[control], property, GetEmptyString);
}
public ConfigurationGuiBinding BindString(Control control, string property)
{
return BindString(control, property, GetEmptyString);
}
public ConfigurationGuiBinding BindString(Control control, string property, Func<string> defaultValueProvider)
{
if (control is TextBoxBase || control is ComboBox) {
SimpleTextBinding binding = new SimpleTextBinding(control);
SimpleTextBinding binding = new SimpleTextBinding(control, defaultValueProvider);
AddBinding(property, binding);
control.TextChanged += ControlValueChanged;
if (control is ComboBox) {
@ -237,20 +244,25 @@ namespace ICSharpCode.SharpDevelop.Project @@ -237,20 +244,25 @@ namespace ICSharpCode.SharpDevelop.Project
class SimpleTextBinding : ConfigurationGuiBinding
{
Control control;
Func<string> defaultValueProvider;
public SimpleTextBinding(Control control)
public SimpleTextBinding(Control control, Func<string> defaultValueProvider)
{
this.defaultValueProvider = defaultValueProvider;
this.control = control;
}
public override void Load()
{
control.Text = Get("");
control.Text = Get(defaultValueProvider());
}
public override bool Save()
{
Set(control.Text);
if (control.Text == defaultValueProvider())
Set("");
else
Set(control.Text);
return true;
}
}

4
src/Main/Base/Project/Src/Project/MSBuildProject.cs

@ -43,8 +43,6 @@ namespace ICSharpCode.SharpDevelop.Project @@ -43,8 +43,6 @@ namespace ICSharpCode.SharpDevelop.Project
BaseConfiguration.SetIsGuarded("Platform", true);
configurations["Debug|*"] = new PropertyGroup();
configurations["Debug|*"]["BaseIntermediateOutputPath"] = @"obj\";
configurations["Debug|*"]["IntermediateOutputPath"] = @"obj\Debug\";
if (information.CreateProjectWithDefaultOutputPath) {
configurations["Debug|*"]["OutputPath"] = @"bin\Debug\";
}
@ -54,8 +52,6 @@ namespace ICSharpCode.SharpDevelop.Project @@ -54,8 +52,6 @@ namespace ICSharpCode.SharpDevelop.Project
configurations["Debug|*"]["DebugType"] = "Full";
configurations["Release|*"] = new PropertyGroup();
configurations["Release|*"]["BaseIntermediateOutputPath"] = @"obj\";
configurations["Release|*"]["IntermediateOutputPath"] = @"obj\Release\";
if (information.CreateProjectWithDefaultOutputPath) {
configurations["Release|*"]["OutputPath"] = @"bin\Release\";
}

Loading…
Cancel
Save