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. 30
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs
  2. 8
      src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs

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

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

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

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

Loading…
Cancel
Save