Browse Source

Fixed SD2-425: Improve project options

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@508 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
283a39e280
  1. 12
      src/AddIns/BackendBindings/CSharpBinding/Project/Resources/BuildOptions.xfrm
  2. 29
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.cs
  3. 16
      src/AddIns/BackendBindings/VBNetBinding/Project/Resources/BuildOptions.xfrm
  4. 34
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/OptionPanels/BuildOptions.cs
  5. 12
      src/Main/Base/Project/Resources/ProjectOptions/ApplicationSettings.xfrm
  6. 4
      src/Main/Base/Project/Resources/ProjectOptions/DebugOptions.xfrm
  7. 64
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs
  8. 20
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ApplicationSettings.cs
  9. 13
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/BuildEvents.cs
  10. 23
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/DebugOptions.cs
  11. 4
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ReferencePaths.cs
  12. 24
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/Signing.cs
  13. 20
      src/Main/Base/Project/Src/Project/AbstractProject.cs
  14. 8
      src/Main/Base/Project/Src/Project/ChooseStorageLocationButton.cs
  15. 45
      src/Main/Base/Project/Src/Project/ConfigurationGuiBinding.cs
  16. 26
      src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs
  17. 9
      src/Main/Base/Project/Src/Services/RefactoringService/RefactoringService.cs

12
src/AddIns/BackendBindings/CSharpBinding/Project/Resources/BuildOptions.xfrm

@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
</Controls>
</System.Windows.Forms.GroupBox>
<System.Windows.Forms.GroupBox>
<Name value="groupBox3" />
<Name value="outputGroupBox" />
<Location value="{X=3,Y=161}" />
<Text value="${res:Dialog.ProjectOptions.Build.Output}" />
<Size value="{Width=521, Height=270}" />
@ -162,11 +162,11 @@ @@ -162,11 +162,11 @@
<Location value="{X=164,Y=88}" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.Label>
<Name value="label6" />
<Location value="{X=6,Y=86}" />
<Name value="debugInfoLabel" />
<Location value="{X=13,Y=86}" />
<Text value="${res:Dialog.ProjectOptions.Build.DebugInfo}" />
<TextAlign value="MiddleRight" />
<Size value="{Width=152, Height=23}" />
<Size value="{Width=145, Height=23}" />
<TabIndex value="5" />
</System.Windows.Forms.Label>
<System.Windows.Forms.CheckBox>
@ -212,7 +212,7 @@ @@ -212,7 +212,7 @@
</Controls>
</System.Windows.Forms.GroupBox>
<System.Windows.Forms.GroupBox>
<Name value="groupBox2" />
<Name value="treatWarningsAsErrorsGroupBox" />
<Location value="{X=3,Y=523}" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.TreatWarningsAsErrors}" />
@ -254,7 +254,7 @@ @@ -254,7 +254,7 @@
</Controls>
</System.Windows.Forms.GroupBox>
<System.Windows.Forms.GroupBox>
<Name value="groupBox1" />
<Name value="warningsGroupBox" />
<Location value="{X=3,Y=437}" />
<Text value="${res:Dialog.ProjectOptions.Build.ErrorsAndWarnings}" />
<Size value="{Width=521, Height=80}" />

29
src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.cs

@ -30,20 +30,37 @@ namespace CSharpBinding.OptionPanels @@ -30,20 +30,37 @@ namespace CSharpBinding.OptionPanels
InitOutputPath();
InitXmlDoc();
helper.BindString("conditionalSymbolsTextBox", "DefineConstants");
helper.BindBoolean("optimizeCodeCheckBox", "Optimize", false);
helper.BindBoolean("allowUnsafeCodeCheckBox", "AllowUnsafeBlocks", false);
helper.BindBoolean("checkForOverflowCheckBox", "CheckForOverflowUnderflow", false);
helper.BindBoolean("noCorlibCheckBox", "NoStdLib", false);
ConfigurationGuiBinding b;
b = helper.BindString("conditionalSymbolsTextBox", "DefineConstants");
b.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
b.CreateLocationButton("conditionalSymbolsTextBox");
b = helper.BindBoolean("optimizeCodeCheckBox", "Optimize", false);
b.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
b.CreateLocationButton("optimizeCodeCheckBox");
b = helper.BindBoolean("allowUnsafeCodeCheckBox", "AllowUnsafeBlocks", false);
b.CreateLocationButton("allowUnsafeCodeCheckBox");
b = helper.BindBoolean("checkForOverflowCheckBox", "CheckForOverflowUnderflow", false);
b.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
b.CreateLocationButton("checkForOverflowCheckBox");
b = helper.BindBoolean("noCorlibCheckBox", "NoStdLib", false);
b.CreateLocationButton("noCorlibCheckBox");
InitAdvanced();
helper.BindStringEnum("fileAlignmentComboBox", "FileAlignment",
b = helper.BindStringEnum("fileAlignmentComboBox", "FileAlignment",
"4096",
new StringPair("512", "512"),
new StringPair("1024", "1024"),
new StringPair("2048", "2048"),
new StringPair("4096", "4096"),
new StringPair("8192", "8192"));
b.DefaultLocation = PropertyStorageLocations.PlatformSpecific;
b.RegisterLocationButton(advancedLocationButton);
InitWarnings();
helper.AddConfigurationSelector(this);

16
src/AddIns/BackendBindings/VBNetBinding/Project/Resources/BuildOptions.xfrm

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
<Size value="{Width=132, Height=21}" />
<FormattingEnabled value="True" />
<DropDownStyle value="DropDownList" />
<Location value="{X=289,Y=125}" />
<Location value="{X=317,Y=125}" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.ComboBox>
<Name value="optionStrictComboBox" />
@ -26,12 +26,12 @@ @@ -26,12 +26,12 @@
<Size value="{Width=132, Height=21}" />
<FormattingEnabled value="True" />
<DropDownStyle value="DropDownList" />
<Location value="{X=151,Y=125}" />
<Location value="{X=179,Y=125}" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.ComboBox>
<Name value="optionExplicitComboBox" />
<TabIndex value="6" />
<Size value="{Width=132, Height=21}" />
<Size value="{Width=160, Height=21}" />
<FormattingEnabled value="True" />
<DropDownStyle value="DropDownList" />
<Location value="{X=13,Y=125}" />
@ -161,11 +161,11 @@ @@ -161,11 +161,11 @@
<Location value="{X=164,Y=88}" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.Label>
<Name value="label6" />
<Location value="{X=6,Y=86}" />
<Name value="debugInfoLabel" />
<Location value="{X=13,Y=86}" />
<Text value="${res:Dialog.ProjectOptions.Build.DebugInfo}" />
<TextAlign value="MiddleRight" />
<Size value="{Width=152, Height=23}" />
<Size value="{Width=145, Height=23}" />
<TabIndex value="5" />
</System.Windows.Forms.Label>
<System.Windows.Forms.CheckBox>
@ -211,7 +211,7 @@ @@ -211,7 +211,7 @@
</Controls>
</System.Windows.Forms.GroupBox>
<System.Windows.Forms.GroupBox>
<Name value="groupBox2" />
<Name value="treatWarningsAsErrorsGroupBox" />
<Location value="{X=3,Y=501}" />
<Text value="${res:Dialog.ProjectOptions.Build.TreatWarningsAsErrors}" />
<Size value="{Width=521, Height=100}" />
@ -252,7 +252,7 @@ @@ -252,7 +252,7 @@
</Controls>
</System.Windows.Forms.GroupBox>
<System.Windows.Forms.GroupBox>
<Name value="groupBox1" />
<Name value="warningsGroupBox" />
<Location value="{X=3,Y=415}" />
<Text value="${res:Dialog.ProjectOptions.Build.ErrorsAndWarnings}" />
<Size value="{Width=521, Height=80}" />

34
src/AddIns/BackendBindings/VBNetBinding/Project/Src/OptionPanels/BuildOptions.cs

@ -27,19 +27,32 @@ namespace VBNetBinding.OptionPanels @@ -27,19 +27,32 @@ namespace VBNetBinding.OptionPanels
SetupFromXmlResource("BuildOptions.xfrm");
InitializeHelper();
helper.BindString("conditionalSymbolsTextBox", "DefineConstants");
helper.BindBoolean("optimizeCodeCheckBox", "Optimize", false);
helper.BindBoolean("removeOverflowCheckBox", "RemoveIntegerChecks", false);
ConfigurationGuiBinding b;
helper.BindStringEnum("optionStrictComboBox", "OptionStrict", "Off",
new StringPair("Off", "Strict Off"),
new StringPair("On", "Strict On"));
helper.BindStringEnum("optionExplicitComboBox", "OptionExplicit", "On",
b = helper.BindString("conditionalSymbolsTextBox", "DefineConstants");
b.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
b.CreateLocationButton("conditionalSymbolsTextBox");
b = helper.BindBoolean("optimizeCodeCheckBox", "Optimize", false);
b.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
b.CreateLocationButton("optimizeCodeCheckBox");
b = helper.BindBoolean("removeOverflowCheckBox", "RemoveIntegerChecks", false);
b.CreateLocationButton("removeOverflowCheckBox");
ChooseStorageLocationButton locationButton;
b = helper.BindStringEnum("optionExplicitComboBox", "OptionExplicit", "On",
new StringPair("Off", "Explicit Off"),
new StringPair("On", "Explicit On"));
helper.BindStringEnum("optionCompareComboBox", "OptionCompare", "Binary",
locationButton = b.CreateLocationButton("optionExplicitComboBox");
b = helper.BindStringEnum("optionStrictComboBox", "OptionStrict", "Off",
new StringPair("Off", "Strict Off"),
new StringPair("On", "Strict On"));
b.RegisterLocationButton(locationButton);
b = helper.BindStringEnum("optionCompareComboBox", "OptionCompare", "Binary",
new StringPair("Binary", "Compare Binary"),
new StringPair("Text", "Compare Text"));
b.RegisterLocationButton(locationButton);
InitOutputPath();
InitXmlDoc();
@ -48,10 +61,5 @@ namespace VBNetBinding.OptionPanels @@ -48,10 +61,5 @@ namespace VBNetBinding.OptionPanels
helper.AddConfigurationSelector(this);
}
public override bool StorePanelContents()
{
return base.StorePanelContents();
}
}
}

12
src/Main/Base/Project/Resources/ProjectOptions/ApplicationSettings.xfrm

@ -120,23 +120,23 @@ @@ -120,23 +120,23 @@
<Name value="startupObjectComboBox" />
<TabIndex value="7" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=288, Height=21}" />
<Size value="{Width=275, Height=21}" />
<FormattingEnabled value="True" />
<Location value="{X=160,Y=112}" />
<Location value="{X=173,Y=112}" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.Label>
<Name value="label4" />
<Location value="{X=160,Y=96}" />
<Location value="{X=173,Y=96}" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.StartupObject}" />
<TextAlign value="BottomLeft" />
<Size value="{Width=288, Height=16}" />
<Size value="{Width=275, Height=16}" />
<TabIndex value="6" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.Label>
<System.Windows.Forms.ComboBox>
<Name value="outputTypeComboBox" />
<TabIndex value="5" />
<Size value="{Width=136, Height=21}" />
<Size value="{Width=159, Height=21}" />
<FormattingEnabled value="True" />
<DropDownStyle value="DropDownList" />
<Location value="{X=8,Y=112}" />
@ -146,7 +146,7 @@ @@ -146,7 +146,7 @@
<Location value="{X=8,Y=96}" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.OutputType}" />
<TextAlign value="BottomLeft" />
<Size value="{Width=136, Height=16}" />
<Size value="{Width=159, Height=16}" />
<TabIndex value="4" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>

4
src/Main/Base/Project/Resources/ProjectOptions/DebugOptions.xfrm

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
<ClientSize value="{Width=480, Height=312}" />
<Controls>
<System.Windows.Forms.GroupBox>
<Name value="groupBox1" />
<Name value="startActionGroupBox" />
<Location value="{X=8,Y=8}" />
<Text value="${res:Dialog.ProjectOptions.DebugOptions.StartAction}" />
<Size value="{Width=464, Height=100}" />
@ -57,7 +57,7 @@ @@ -57,7 +57,7 @@
</Controls>
</System.Windows.Forms.GroupBox>
<System.Windows.Forms.GroupBox>
<Name value="groupBox2" />
<Name value="startOptionsGroupBox" />
<Location value="{X=8,Y=120}" />
<Text value="${res:Dialog.ProjectOptions.DebugOptions.StartOptions}" />
<Size value="{Width=464, Height=80}" />

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

@ -29,17 +29,28 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -29,17 +29,28 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
protected void InitXmlDoc()
{
helper.BindString("xmlDocumentationTextBox", "DocumentationFile");
ConfigurationGuiBinding b;
b = helper.BindString("xmlDocumentationTextBox", "DocumentationFile");
b.CreateLocationButton("xmlDocumentationCheckBox");
helper.Loaded += XmlDocHelperLoaded;
XmlDocHelperLoaded(null, null);
}
void XmlDocHelperLoaded(object sender, EventArgs e)
{
Get<CheckBox>("xmlDocumentation").CheckedChanged -= UpdateXmlEnabled;
Get<CheckBox>("xmlDocumentation").Checked = Get<TextBox>("xmlDocumentation").Text.Length > 0;
Get<CheckBox>("xmlDocumentation").CheckedChanged += new EventHandler(UpdateXmlEnabled);
Get<CheckBox>("xmlDocumentation").CheckedChanged += UpdateXmlEnabled;
Get<TextBox>("xmlDocumentation").Enabled = Get<CheckBox>("xmlDocumentation").Checked;
}
void UpdateXmlEnabled(object sender, EventArgs e)
{
Get<TextBox>("xmlDocumentation").Enabled = Get<CheckBox>("xmlDocumentation").Checked;
if (Get<CheckBox>("xmlDocumentation").Checked && Get<TextBox>("xmlDocumentation").Text.Length == 0) {
if (Get<CheckBox>("xmlDocumentation").Checked) {
if (Get<TextBox>("xmlDocumentation").Text.Length == 0) {
Get<TextBox>("xmlDocumentation").Text = FileUtility.GetRelativePath(baseDirectory, project.OutputAssemblyFullPath) + ".xml";
}
} else {
Get<TextBox>("xmlDocumentation").Text = "";
}
@ -47,17 +58,23 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -47,17 +58,23 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
protected void InitWarnings()
{
helper.BindStringEnum("warningLevelComboBox", "WarningLevel",
ConfigurationGuiBinding b;
b = helper.BindStringEnum("warningLevelComboBox", "WarningLevel",
"4",
new StringPair("0", "0"),
new StringPair("1", "1"),
new StringPair("2", "2"),
new StringPair("3", "3"),
new StringPair("4", "4"));
helper.BindString("suppressWarningsTextBox", "NoWarn");
ChooseStorageLocationButton locationButton = b.CreateLocationButtonInPanel("warningsGroupBox");
b = helper.BindString("suppressWarningsTextBox", "NoWarn");
b.RegisterLocationButton(locationButton);
helper.AddBinding("TreatWarningsAsErrors", new WarningsAsErrorsBinding(this));
helper.BindString("specificWarningsTextBox", "WarningsAsErrors"); // must be saved AFTER TreatWarningsAsErrors
b = new WarningsAsErrorsBinding(this);
helper.AddBinding("TreatWarningsAsErrors", b);
locationButton = b.CreateLocationButtonInPanel("treatWarningsAsErrorsGroupBox");
b = helper.BindString("specificWarningsTextBox", "WarningsAsErrors"); // must be saved AFTER TreatWarningsAsErrors
b.RegisterLocationButton(locationButton);
Get<RadioButton>("specificWarnings").CheckedChanged += new EventHandler(UpdateWarningChecked);
@ -111,37 +128,46 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -111,37 +128,46 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
}
ConfigurationGuiBinding debugInfoBinding;
protected ChooseStorageLocationButton advancedLocationButton;
protected void InitAdvanced()
{
debugInfoBinding = helper.BindEnum<DebugSymbolType>("debugInfoComboBox", "DebugType");
helper.BindBoolean("registerCOMInteropCheckBox", "RegisterForComInterop", false);
helper.BindStringEnum("generateSerializationAssemblyComboBox", "GenerateSerializationAssemblies",
debugInfoBinding.CreateLocationButton("debugInfoLabel");
ConfigurationGuiBinding b;
b = helper.BindBoolean("registerCOMInteropCheckBox", "RegisterForComInterop", false);
b.DefaultLocation = PropertyStorageLocations.PlatformSpecific;
advancedLocationButton = b.CreateLocationButtonInPanel("advancedOutputGroupBox");
b = helper.BindStringEnum("generateSerializationAssemblyComboBox", "GenerateSerializationAssemblies",
"Auto",
new StringPair("Off", "Off"),
new StringPair("On", "On"),
new StringPair("Auto", "Auto"));
helper.BindHexadecimal(Get<TextBox>("dllBaseAddress"), "BaseAddress", 0x400000);
helper.BindStringEnum("targetCpuComboBox", "PlatformTarget",
b.DefaultLocation = PropertyStorageLocations.PlatformSpecific;
b.RegisterLocationButton(advancedLocationButton);
b = helper.BindHexadecimal(Get<TextBox>("dllBaseAddress"), "BaseAddress", 0x400000);
b.DefaultLocation = PropertyStorageLocations.PlatformSpecific;
b.RegisterLocationButton(advancedLocationButton);
b = helper.BindStringEnum("targetCpuComboBox", "PlatformTarget",
"AnyCPU",
new StringPair("AnyCPU", "${res:Dialog.ProjectOptions.Build.TargetCPU.Any}"),
new StringPair("x86", "${res:Dialog.ProjectOptions.Build.TargetCPU.x86}"),
new StringPair("x64", "${res:Dialog.ProjectOptions.Build.TargetCPU.x64}"),
new StringPair("Itanium", "${res:Dialog.ProjectOptions.Build.TargetCPU.Itanium}"));
}
b.DefaultLocation = PropertyStorageLocations.PlatformSpecific;
b.RegisterLocationButton(advancedLocationButton);
public override bool StorePanelContents()
{
if (base.StorePanelContents()) {
helper.Saved += delegate {
if ((DebugSymbolType)Get<ComboBox>("debugInfo").SelectedIndex == DebugSymbolType.Full) {
helper.SetProperty("DebugSymbols", "true", debugInfoBinding.Location);
} else {
helper.SetProperty("DebugSymbols", "false", debugInfoBinding.Location);
}
return true;
} else {
return false;
}
};
}
}
}

20
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ApplicationSettings.cs

@ -31,20 +31,28 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -31,20 +31,28 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
// TODO: Suitable file filter.
ConnectBrowseButton("win32ResourceFileBrowseButton", "win32ResourceFileComboBox");
helper.BindString("assemblyNameTextBox", "AssemblyName");
ConfigurationGuiBinding b;
ChooseStorageLocationButton locationButton;
b = helper.BindString("assemblyNameTextBox", "AssemblyName");
b.CreateLocationButton("assemblyNameTextBox");
Get<TextBox>("assemblyName").TextChanged += new EventHandler(RefreshOutputNameTextBox);
helper.BindString("rootNamespaceTextBox", "RootNamespace");
b = helper.BindString("rootNamespaceTextBox", "RootNamespace");
b.CreateLocationButton("rootNamespaceTextBox");
helper.BindEnum<OutputType>("outputTypeComboBox", "OutputType");
b = helper.BindEnum<OutputType>("outputTypeComboBox", "OutputType");
locationButton = b.CreateLocationButton("outputTypeComboBox");
Get<ComboBox>("outputType").SelectedIndexChanged += new EventHandler(RefreshOutputNameTextBox);
helper.BindString("startupObjectComboBox", "StartupObject");
b = helper.BindString("startupObjectComboBox", "StartupObject");
b.RegisterLocationButton(locationButton);
helper.BindString("applicationIconComboBox", "ApplicationIcon");
b = helper.BindString("applicationIconComboBox", "ApplicationIcon");
Get<ComboBox>("applicationIcon").TextChanged += new EventHandler(ApplicationIconComboBoxTextChanged);
b.CreateLocationButton("applicationIconComboBox");
helper.BindString("win32ResourceFileComboBox", "Win32Resource");
b = helper.BindString("win32ResourceFileComboBox", "Win32Resource");
b.CreateLocationButton("win32ResourceFileComboBox");
Get<TextBox>("projectFolder").Text = project.Directory;
Get<TextBox>("projectFile").Text = Path.GetFileName(project.FileName);

13
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/BuildEvents.cs

@ -30,9 +30,16 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -30,9 +30,16 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
"postBuildEventTextBox",
"${res:SharpDevelop.FileFilter.AllFiles}|*.*");
helper.BindString("preBuildEventTextBox", "PreBuildEvent");
helper.BindString("postBuildEventTextBox", "PostBuildEvent");
helper.BindEnum<RunPostBuildEvent>("runPostBuildEventComboBox", "RunPostBuildEvent");
ConfigurationGuiBinding b;
b = helper.BindString("preBuildEventTextBox", "PreBuildEvent");
b.CreateLocationButton("preBuildEventTextBox");
b = helper.BindString("postBuildEventTextBox", "PostBuildEvent");
b.CreateLocationButton("postBuildEventTextBox");
b = helper.BindEnum<RunPostBuildEvent>("runPostBuildEventComboBox", "RunPostBuildEvent");
b.CreateLocationButton("runPostBuildEventComboBox");
helper.AddConfigurationSelector(this);
}

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

@ -27,18 +27,31 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -27,18 +27,31 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
InitializeHelper();
helper.BindRadioEnum("StartAction",
ConfigurationGuiBinding b;
ChooseStorageLocationButton locationButton;
b = helper.BindRadioEnum("StartAction",
new RadioBinding(StartAction.Project, Get<RadioButton>("startProject")),
new RadioBinding(StartAction.Program, Get<RadioButton>("startExternalProgram")),
new RadioBinding(StartAction.StartURL, Get<RadioButton>("startBrowserInURL")));
b.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
locationButton = b.CreateLocationButtonInPanel("startActionGroupBox");
b = helper.BindString("startExternalProgramTextBox", "StartProgram");
b.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
b.RegisterLocationButton(locationButton);
b = helper.BindString("startBrowserInURLTextBox", "StartURL");
b.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
b.RegisterLocationButton(locationButton);
Get<RadioButton>("startExternalProgram").CheckedChanged += UpdateEnabledStates;
Get<RadioButton>("startBrowserInURL").CheckedChanged += UpdateEnabledStates;
helper.BindString("startExternalProgramTextBox", "StartProgram");
helper.BindString("startBrowserInURLTextBox", "StartURL");
helper.BindString("commandLineArgumentsTextBox", "StartArguments");
helper.BindString("workingDirectoryTextBox", "StartWorkingDirectory");
b = helper.BindString("commandLineArgumentsTextBox", "StartArguments");
locationButton = b.CreateLocationButtonInPanel("startOptionsGroupBox");
b = helper.BindString("workingDirectoryTextBox", "StartWorkingDirectory");
b.RegisterLocationButton(locationButton);
UpdateEnabledStates(this, EventArgs.Empty);

4
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ReferencePaths.cs

@ -27,8 +27,10 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -27,8 +27,10 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
editor.TitleText = StringParser.Parse("&${res:Dialog.ExportProjectToHtml.FolderLabel}");
editor.AddButtonText = StringParser.Parse("${res:Dialog.ProjectOptions.ReferencePaths.AddPath}");
editor.ListChanged += delegate { IsDirty = true; };
helper.AddBinding("ReferencePath", new SemicolonSeparatedStringListBinding(editor));
SemicolonSeparatedStringListBinding b = new SemicolonSeparatedStringListBinding(editor);
helper.AddBinding("ReferencePath", b);
this.Controls.Add(editor);
b.CreateLocationButton(editor);
helper.AddConfigurationSelector(this);
}

24
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/Signing.cs

@ -27,12 +27,17 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -27,12 +27,17 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
SetupFromXmlResource("ProjectOptions.Signing.xfrm");
InitializeHelper();
ConfigurationGuiBinding b;
ChooseStorageLocationButton locationButton;
signAssemblyBinding = helper.BindBoolean("signAssemblyCheckBox", "SignAssembly", false);
locationButton = signAssemblyBinding.CreateLocationButtonInPanel("signingGroupBox");
Get<CheckBox>("signAssembly").CheckedChanged += new EventHandler(UpdateEnabledStates);
keyFile = Get<ComboBox>("keyFile");
helper.BindString(keyFile, "AssemblyOriginatorKeyFile");
b = helper.BindString(keyFile, "AssemblyOriginatorKeyFile");
b.RegisterLocationButton(locationButton);
FindKeys(baseDirectory);
if (keyFile.Text.Length > 0) {
if (!keyFile.Items.Contains(keyFile.Text)) {
@ -50,11 +55,18 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -50,11 +55,18 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
}
};
helper.BindBoolean("delaySignOnlyCheckBox", "DelaySign", false);
b = helper.BindBoolean("delaySignOnlyCheckBox", "DelaySign", false);
b.RegisterLocationButton(locationButton);
UpdateEnabledStates(this, EventArgs.Empty);
helper.AddConfigurationSelector(this);
helper.Saved += delegate {
if (Get<CheckBox>("signAssembly").Checked) {
helper.SetProperty("AssemblyOriginatorKeyMode", "File", signAssemblyBinding.Location);
}
};
}
void FindKeys(string directory)
@ -102,13 +114,5 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -102,13 +114,5 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
Get<Button>("changePassword").Enabled = false;
}
public override bool StorePanelContents()
{
if (IsDirty && Get<CheckBox>("signAssembly").Checked) {
helper.SetProperty("AssemblyOriginatorKeyMode", "File", signAssemblyBinding.Location);
}
return base.StorePanelContents();
}
}
}

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

@ -363,7 +363,10 @@ namespace ICSharpCode.SharpDevelop.Project @@ -363,7 +363,10 @@ namespace ICSharpCode.SharpDevelop.Project
if (pg != null) {
return pg.Get(property, defaultValue);
} else {
location = PropertyStorageLocations.Unknown;
// we need to look for the property in other configurations.
// For example, "XML doc" might only exist in the release build, so we have
// to set the correct location even though the property is not found in debug conf.
location = FindProperty(configurationName, platform, property);
return defaultValue;
}
}
@ -378,6 +381,21 @@ namespace ICSharpCode.SharpDevelop.Project @@ -378,6 +381,21 @@ namespace ICSharpCode.SharpDevelop.Project
}
FindProperty(configurationName, platform, property,
BaseConfiguration, configurations, ref location);
if (location == PropertyStorageLocations.Unknown) {
// we need to look for the property in other configurations.
// For example, "XML doc" might only exist in the release build, so we have
// to set the correct location even though the property is not found in debug conf.
foreach (KeyValuePair<string, PropertyGroup> pair in userConfigurations) {
if (pair.Value.IsSet(property)) {
return GetLocationFromConfigKey(pair.Key) | PropertyStorageLocations.UserFile;
}
}
foreach (KeyValuePair<string, PropertyGroup> pair in configurations) {
if (pair.Value.IsSet(property)) {
return GetLocationFromConfigKey(pair.Key);
}
}
}
return location;
}

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

@ -29,6 +29,12 @@ namespace ICSharpCode.SharpDevelop.Project @@ -29,6 +29,12 @@ namespace ICSharpCode.SharpDevelop.Project
CreateMenuItem("${res:Dialog.ProjectOptions.StoreInUserFile}", PropertyStorageLocations.UserFile)
};
ContextMenuStrip.Items.AddRange(menuItems);
ContextMenuStrip.Items.Add(new ToolStripSeparator());
// TODO: Link to the SharpDevelop documentation and explain not only the location-thing, but also what the property clicked actually is.
ContextMenuStrip.Items.Add(StringParser.Parse("${res:Global.HelpButtonText}"), null, delegate {
MessageService.ShowMessage("${res:Dialog.ProjectOptions.StorageLocationHelp}");
});
}
ToolStripMenuItem CreateMenuItem(string text, PropertyStorageLocations location)
@ -61,9 +67,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -61,9 +67,7 @@ namespace ICSharpCode.SharpDevelop.Project
set {
if ((value & PropertyStorageLocations.ConfigurationAndPlatformSpecific) != 0) {
// remove 'Base' flag if any of the specific flags is set
if ((value & PropertyStorageLocations.Base) == PropertyStorageLocations.Base) {
value &= ~PropertyStorageLocations.Base;
}
} else {
// otherwise, add 'Base' flag
value |= PropertyStorageLocations.Base;

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

@ -77,15 +77,43 @@ namespace ICSharpCode.SharpDevelop.Project @@ -77,15 +77,43 @@ namespace ICSharpCode.SharpDevelop.Project
public ChooseStorageLocationButton CreateLocationButton()
{
ChooseStorageLocationButton btn = new ChooseStorageLocationButton();
this.storageLocationButton = btn;
if (location == PropertyStorageLocations.Unknown) {
btn.StorageLocation = defaultLocation;
} else {
btn.StorageLocation = location;
}
RegisterLocationButton(btn);
return btn;
}
/// <summary>
/// Makes this configuration binding being controlled by the specified button.
/// Use this method if you want to use one ChooseStorageLocationButton to control
/// multiple properties.
/// </summary>
public void RegisterLocationButton(ChooseStorageLocationButton btn)
{
this.storageLocationButton = btn;
btn.StorageLocationChanged += delegate(object sender, EventArgs e) {
this.Location = ((ChooseStorageLocationButton)sender).StorageLocation;
};
}
public ChooseStorageLocationButton CreateLocationButtonInPanel(string panelName)
{
ChooseStorageLocationButton btn = CreateLocationButton();
Control panel = Helper.ControlDictionary[panelName];
foreach (Control ctl in panel.Controls) {
if ((ctl.Anchor & AnchorStyles.Left) == AnchorStyles.Left) {
ctl.Left += btn.Width + 8;
if ((ctl.Anchor & AnchorStyles.Right) == AnchorStyles.Right) {
ctl.Width -= btn.Width + 8;
}
}
}
btn.Location = new Point(4, (panel.ClientSize.Height - btn.Height) / 2);
panel.Controls.Add(btn);
panel.Controls.SetChildIndex(btn, 0);
return btn;
}
@ -93,16 +121,16 @@ namespace ICSharpCode.SharpDevelop.Project @@ -93,16 +121,16 @@ namespace ICSharpCode.SharpDevelop.Project
/// Moves the control '<paramref name="controlName"/>' a bit to the right and inserts a
/// <see cref="ChooseStorageLocationButton"/>.
/// </summary>
public void CreateLocationButton(string controlName)
public ChooseStorageLocationButton CreateLocationButton(string controlName)
{
CreateLocationButton(Helper.ControlDictionary[controlName]);
return CreateLocationButton(Helper.ControlDictionary[controlName]);
}
/// <summary>
/// Moves the <paramref name="replacedControl"/> a bit to the right and inserts a
/// <see cref="ChooseStorageLocationButton"/>.
/// </summary>
public void CreateLocationButton(Control replacedControl)
public ChooseStorageLocationButton CreateLocationButton(Control replacedControl)
{
ChooseStorageLocationButton btn = CreateLocationButton();
btn.Location = new Point(replacedControl.Left, replacedControl.Top + (replacedControl.Height - btn.Height) / 2);
@ -110,11 +138,20 @@ namespace ICSharpCode.SharpDevelop.Project @@ -110,11 +138,20 @@ namespace ICSharpCode.SharpDevelop.Project
replacedControl.Width -= btn.Width + 4;
replacedControl.Parent.Controls.Add(btn);
replacedControl.Parent.Controls.SetChildIndex(btn, replacedControl.Parent.Controls.IndexOf(replacedControl));
return btn;
}
bool isFirstGet = true;
public T Get<T>(T defaultValue)
{
if (isFirstGet) {
isFirstGet = false;
return helper.GetProperty(property, defaultValue, out location);
} else {
PropertyStorageLocations tmp;
return helper.GetProperty(property, defaultValue, out tmp);
}
}
public void Set<T>(T value)

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

@ -73,6 +73,9 @@ namespace ICSharpCode.SharpDevelop.Project @@ -73,6 +73,9 @@ namespace ICSharpCode.SharpDevelop.Project
foreach (ConfigurationGuiBinding binding in bindings) {
binding.Load();
}
if (Loaded != null) {
Loaded(this, EventArgs.Empty);
}
IsDirty = false;
}
@ -83,10 +86,23 @@ namespace ICSharpCode.SharpDevelop.Project @@ -83,10 +86,23 @@ namespace ICSharpCode.SharpDevelop.Project
return false;
}
}
if (Saved != null) {
Saved(this, EventArgs.Empty);
}
IsDirty = false;
return true;
}
/// <summary>
/// This event is raised when another configuration has been loaded.
/// </summary>
public event EventHandler Loaded;
/// <summary>
/// This event is raised after the configuration has been saved.
/// </summary>
public event EventHandler Saved;
void ControlValueChanged(object sender, EventArgs e)
{
IsDirty = true;
@ -329,16 +345,16 @@ namespace ICSharpCode.SharpDevelop.Project @@ -329,16 +345,16 @@ namespace ICSharpCode.SharpDevelop.Project
/// Bind list of strings to ComboBox.
/// entries: value -> Description
/// </summary>
public void BindStringEnum(string control, string property, string defaultValue, params KeyValuePair<string, string>[] entries)
public ConfigurationGuiBinding BindStringEnum(string control, string property, string defaultValue, params KeyValuePair<string, string>[] entries)
{
BindStringEnum(controlDictionary[control], property, defaultValue, entries);
return BindStringEnum(controlDictionary[control], property, defaultValue, entries);
}
/// <summary>
/// Bind list of strings to ComboBox.
/// entries: value -> Description
/// </summary>
public void BindStringEnum(Control control, string property, string defaultValue, params KeyValuePair<string, string>[] entries)
public ConfigurationGuiBinding BindStringEnum(Control control, string property, string defaultValue, params KeyValuePair<string, string>[] entries)
{
ComboBox comboBox = control as ComboBox;
if (comboBox != null) {
@ -347,9 +363,11 @@ namespace ICSharpCode.SharpDevelop.Project @@ -347,9 +363,11 @@ namespace ICSharpCode.SharpDevelop.Project
valueNames[i] = entries[i].Key;
comboBox.Items.Add(StringParser.Parse(entries[i].Value));
}
AddBinding(property, new ComboBoxBinding(comboBox, valueNames, defaultValue));
ComboBoxBinding binding = new ComboBoxBinding(comboBox, valueNames, defaultValue);
AddBinding(property, binding);
comboBox.SelectedIndexChanged += ControlValueChanged;
comboBox.KeyDown += ComboBoxKeyDown;
return binding;
} else {
throw new ApplicationException("Cannot bind " + control.GetType().Name + " to enum property.");
}

9
src/Main/Base/Project/Src/Services/RefactoringService/RefactoringService.cs

@ -104,11 +104,14 @@ namespace ICSharpCode.SharpDevelop.Refactoring @@ -104,11 +104,14 @@ namespace ICSharpCode.SharpDevelop.Refactoring
MessageService.ShowMessage("${res:SharpDevelop.Refactoring.LoadSolutionProjectsThreadRunning}");
return null;
}
if (!isLocal) {
// for local va
List<ProjectItem> files;
if (isLocal) {
files = new List<ProjectItem>();
files.Add(FindItem(ownerClass.CompilationUnit.FileName));
} else {
ownerClass = FixClass(ownerClass);
files = GetPossibleFiles(ownerClass, member);
}
List<ProjectItem> files = GetPossibleFiles(ownerClass, member);
ParseableFileContentEnumerator enumerator = new ParseableFileContentEnumerator(files.ToArray());
List<Reference> references = new List<Reference>();
try {

Loading…
Cancel
Save