diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingOptionsPersistence.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingOptionsPersistence.cs index fafc72e574..a8f726ce99 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingOptionsPersistence.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingOptionsPersistence.cs @@ -118,7 +118,7 @@ namespace CSharpBinding.FormattingStrategy { // Load solution settings SolutionOptions = new CSharpFormattingOptionsPersistence( - e.Solution.GlobalPreferences, + e.Solution.SDSettings, new CSharpFormattingOptionsContainer(GlobalOptions.OptionsContainer) { DefaultText = StringParser.Parse("${res:CSharpBinding.Formatting.SolutionOptionReference}") diff --git a/src/Main/Base/Project/Project/ISolution.cs b/src/Main/Base/Project/Project/ISolution.cs index 39e6202f5e..e1f4047106 100644 --- a/src/Main/Base/Project/Project/ISolution.cs +++ b/src/Main/Base/Project/Project/ISolution.cs @@ -97,7 +97,7 @@ namespace ICSharpCode.SharpDevelop.Project /// Gets a container that can be used to store data about the solution. /// This data is stored along with .sln file as .sln.sdsettings. /// - Properties GlobalPreferences { get; } + Properties SDSettings { get; } /// /// This event is raised by immediately before the preferences are saved to disk. diff --git a/src/Main/SharpDevelop/Project/Solution.cs b/src/Main/SharpDevelop/Project/Solution.cs index fbd48f28b0..1d8b488155 100644 --- a/src/Main/SharpDevelop/Project/Solution.cs +++ b/src/Main/SharpDevelop/Project/Solution.cs @@ -35,7 +35,7 @@ namespace ICSharpCode.SharpDevelop.Project class Solution : SolutionFolder, ISolution { FileName fileName; - FileName globalSettingsFileName; + FileName sdSettingsFileName; DirectoryName directory; readonly IProjectChangeWatcher changeWatcher; readonly IFileService fileService; @@ -52,7 +52,7 @@ namespace ICSharpCode.SharpDevelop.Project this.PlatformNames = new SolutionConfigurationOrPlatformNameCollection(this, true); this.projects = new SynchronizedModelCollection(new ProjectModelCollection(this)); this.FileName = fileName; - this.globalSettingsFileName = new FileName(fileName + ".sdsettings"); + this.sdSettingsFileName = new FileName(fileName + ".sdsettings"); base.Name = fileName.GetFileNameWithoutExtension(); this.globalSections = new SynchronizedModelCollection(new NullSafeSimpleModelCollection()); @@ -281,11 +281,11 @@ namespace ICSharpCode.SharpDevelop.Project get { return preferences; } } - Properties globalPreferences = new Properties(); + Properties sdSettings = new Properties(); [Browsable(false)] - public Properties GlobalPreferences { - get { return globalPreferences; } + public Properties SDSettings { + get { return sdSettings; } } string GetPreferencesKey() @@ -297,7 +297,7 @@ namespace ICSharpCode.SharpDevelop.Project { try { preferences = SD.PropertyService.LoadExtraProperties(GetPreferencesKey()); - globalPreferences = Properties.Load(globalSettingsFileName); + sdSettings = Properties.Load(sdSettingsFileName); } catch (IOException) { } catch (XmlException) { // ignore errors about inaccessible or malformed files @@ -321,7 +321,9 @@ namespace ICSharpCode.SharpDevelop.Project try { SD.PropertyService.SaveExtraProperties(GetPreferencesKey(), preferences); - globalPreferences.Save(globalSettingsFileName); + if (sdSettings.IsDirty) { + sdSettings.Save(sdSettingsFileName); + } } catch (IOException) { // ignore errors writing to extra properties }