diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2014-03-31 15:09:15 +0400 |
---|---|---|
committer | Lluis Sanchez <lluis@xamarin.com> | 2014-03-31 15:09:15 +0400 |
commit | a2fb44c4a2d66ffd94584023ccdc365a5545f37f (patch) | |
tree | 99f59baec9ae4357c063c469e34c3f886c7f72f4 /main/src/core/MonoDevelop.Core | |
parent | 3f8cd2226fa8278d30cb59cc90af1e24e06eb495 (diff) |
[Core] Allow customizing msbuild project save/load
Diffstat (limited to 'main/src/core/MonoDevelop.Core')
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs index 3096e5e974..0b2b77cd31 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs @@ -766,12 +766,17 @@ namespace MonoDevelop.Projects.Formats.MSBuild dotNetProject.TargetFramework = Runtime.SystemAssemblyService.GetTargetFramework (targetFx); } - foreach (var ext in GetMSBuildExtensions ()) - ext.LoadProject (EntityItem, msproject); + LoadFromMSBuildProject (msproject); Item.NeedsReload = false; } + protected virtual void LoadFromMSBuildProject (MSBuildProject msproject) + { + foreach (var ext in GetMSBuildExtensions ()) + ext.LoadProject (EntityItem, msproject); + } + const string RecursiveDirectoryWildcard = "**"; static readonly char[] directorySeparators = new [] { Path.DirectorySeparatorChar, @@ -1309,12 +1314,17 @@ namespace MonoDevelop.Projects.Formats.MSBuild } else msproject.RemoveProjectExtensions ("MonoDevelop"); - foreach (var ext in GetMSBuildExtensions ()) - ext.SaveProject (EntityItem, msproject); + SaveToMSBuildProject (msproject); return msproject; } + protected void SaveToMSBuildProject (MSBuildProject msproject) + { + foreach (var ext in GetMSBuildExtensions ()) + ext.SaveProject (EntityItem, msproject); + } + void SetIfPresentOrNotDefaultValue (MSBuildPropertySet propGroup, string name, string value, string defaultValue, bool isXml = false) { bool hasDefaultValue = string.IsNullOrEmpty (value) || value == defaultValue; |