Browse Source

When DebugType property doesn't exist, use value of DebugSymbols. This prevents SharpDevelop from resetting DebugSymbols to false on imported projects.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1203 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
9893583080
  1. 32
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs
  2. 8
      src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs

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

@ -141,6 +141,9 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -141,6 +141,9 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
{
debugInfoBinding = helper.BindEnum<DebugSymbolType>("debugInfoComboBox", "DebugType");
debugInfoBinding.CreateLocationButton("debugInfoLabel");
DebugSymbolsLoaded(null, null);
helper.Loaded += DebugSymbolsLoaded;
helper.Saved += DebugSymbolsSave;
ConfigurationGuiBinding b;
b = helper.BindBoolean("registerCOMInteropCheckBox", "RegisterForComInterop", false);
@ -167,14 +170,29 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -167,14 +170,29 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
new StringPair("Itanium", "${res:Dialog.ProjectOptions.Build.TargetCPU.Itanium}"));
b.DefaultLocation = PropertyStorageLocations.PlatformSpecific;
b.RegisterLocationButton(advancedLocationButton);
helper.Saved += delegate {
if ((DebugSymbolType)Get<ComboBox>("debugInfo").SelectedIndex == DebugSymbolType.Full) {
helper.SetProperty("DebugSymbols", "true", debugInfoBinding.Location);
} else {
helper.SetProperty("DebugSymbols", "false", debugInfoBinding.Location);
}
void DebugSymbolsLoaded(object sender, EventArgs e)
{
PropertyStorageLocations location;
helper.GetProperty("DebugType", "", out location);
if (location == PropertyStorageLocations.Unknown) {
bool debug = helper.GetProperty("DebugSymbols", false, out location);
if (location != PropertyStorageLocations.Unknown) {
debugInfoBinding.Location = location;
helper.SetProperty("DebugType", debug ? DebugSymbolType.Full : DebugSymbolType.None, location);
debugInfoBinding.Load();
}
};
}
}
void DebugSymbolsSave(object sender, EventArgs e)
{
if ((DebugSymbolType)Get<ComboBox>("debugInfo").SelectedIndex == DebugSymbolType.Full) {
helper.SetProperty("DebugSymbols", "true", debugInfoBinding.Location);
} else {
helper.SetProperty("DebugSymbols", "false", debugInfoBinding.Location);
}
}
protected void InitTargetFramework(string defaultTargets, string extendedTargets)

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

@ -70,6 +70,9 @@ namespace ICSharpCode.SharpDevelop.Project @@ -70,6 +70,9 @@ namespace ICSharpCode.SharpDevelop.Project
public void Load()
{
if (Loading != null) {
Loading(this, EventArgs.Empty);
}
foreach (ConfigurationGuiBinding binding in bindings) {
binding.Load();
}
@ -93,6 +96,11 @@ namespace ICSharpCode.SharpDevelop.Project @@ -93,6 +96,11 @@ namespace ICSharpCode.SharpDevelop.Project
return true;
}
/// <summary>
/// This event is raised when another configuration is beginning to load.
/// </summary>
public event EventHandler Loading;
/// <summary>
/// This event is raised when another configuration has been loaded.
/// </summary>

Loading…
Cancel
Save