diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.xaml.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.xaml.cs index e1fd8a9bc7..d703e144fe 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.xaml.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.xaml.cs @@ -268,7 +268,8 @@ namespace CSharpBinding.OptionPanels private void ChangeOutputPathExecute() { OutputPath.Value = OptionsHelper.BrowseForFolder("${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}", - base.BaseDirectory,base.BaseDirectory,outputPathTextBox.Text); + base.BaseDirectory,base.BaseDirectory, + outputPathTextBox.Text,TextBoxEditMode.EditRawProperty); base.RaisePropertyChanged(()=> OutputPath); } @@ -319,7 +320,8 @@ namespace CSharpBinding.OptionPanels private void BaseIntermediateOutputPathExecute () { BaseIntermediateOutputPath.Value = OptionsHelper.BrowseForFolder("${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}", - base.BaseDirectory,base.BaseDirectory,this.baseIntermediateOutputPathTextBox.Text); + base.BaseDirectory,base.BaseDirectory, + this.baseIntermediateOutputPathTextBox.Text,TextBoxEditMode.EditRawProperty); base.RaisePropertyChanged(()=> BaseIntermediateOutputPath); } @@ -337,7 +339,8 @@ namespace CSharpBinding.OptionPanels private void IntermediateOutputPathExecute () { IntermediateOutputPath.Value = OptionsHelper.BrowseForFolder("${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}", - base.BaseDirectory,base.BaseDirectory,this.intermediateOutputPathTextBox.Text); + base.BaseDirectory,base.BaseDirectory, + this.intermediateOutputPathTextBox.Text,TextBoxEditMode.EditRawProperty); base.RaisePropertyChanged(()=> IntermediateOutputPath); } diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/OptionsHelper.cs b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/OptionsHelper.cs index 5f78b6c0f5..cfa2609ecb 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/OptionsHelper.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/OptionsHelper.cs @@ -4,7 +4,9 @@ using System; using ICSharpCode.Core; +using ICSharpCode.SharpDevelop.Project; using Microsoft.Win32; + namespace ICSharpCode.SharpDevelop.Gui.OptionPanels { /// @@ -13,7 +15,9 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels public class OptionsHelper { - public static string BrowseForFolder(string description,string baseDirectory,string startLocation,string relativeLocation) + public static string BrowseForFolder(string description,string baseDirectory, + string startLocation,string relativeLocation, + TextBoxEditMode textBoxEditMode) { string startAt = startLocation; if (!String.IsNullOrEmpty(relativeLocation)) { @@ -30,12 +34,44 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels } if (!path.EndsWith("\\") && !path.EndsWith("/")) path += "\\"; - return path; + if (textBoxEditMode == TextBoxEditMode.EditEvaluatedProperty) { + return path; + } else { + return MSBuildInternals.Escape(path); + } } } return startLocation; } + /* + public void Event(object sender, EventArgs e) + { + string startLocation = panel.baseDirectory; + if (startLocation != null) { + string text = panel.ControlDictionary[target].Text; + if (textBoxEditMode == TextBoxEditMode.EditRawProperty) + text = MSBuildInternals.Unescape(text); + startLocation = FileUtility.GetAbsolutePath(startLocation, text); + } + + using (FolderBrowserDialog fdiag = FileService.CreateFolderBrowserDialog(description, startLocation)) { + if (fdiag.ShowDialog() == DialogResult.OK) { + string path = fdiag.SelectedPath; + if (panel.baseDirectory != null) { + path = FileUtility.GetRelativePath(panel.baseDirectory, path); + } + if (!path.EndsWith("\\") && !path.EndsWith("/")) + path += "\\"; + if (textBoxEditMode == TextBoxEditMode.EditEvaluatedProperty) { + panel.ControlDictionary[target].Text = path; + } else { + panel.ControlDictionary[target].Text = MSBuildInternals.Escape(path); + } + } + } + } + */ public static string OpenFile (string filter)