diff options
Diffstat (limited to 'main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs | 182 |
1 files changed, 182 insertions, 0 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs new file mode 100644 index 0000000000..a1dd21715c --- /dev/null +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs @@ -0,0 +1,182 @@ +// +// MSBuildProjectExtension.cs +// +// Author: +// Lluis Sanchez Gual <lluis@xamarin.com> +// +// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.Collections.Generic; +using MonoDevelop.Core; +using System.Threading.Tasks; +using MonoDevelop.Projects.Formats.MSBuild; +using Mono.Addins; +using System.Linq; + +namespace MonoDevelop.Projects +{ + public class ProjectExtension: SolutionItemExtension + { + ProjectExtension next; + + public Project Project { + get { return (Project) base.Item; } + } + + internal protected override void InitializeChain (ChainedExtension next) + { + base.InitializeChain (next); + this.next = FindNextImplementation<ProjectExtension> (next); + } + + internal protected override bool SupportsObject (WorkspaceObject item) + { + return item is Project && base.SupportsObject (item); + } + + internal protected virtual bool SupportsFlavor (string guid) + { + if (FlavorGuid != null && guid.Equals (FlavorGuid, StringComparison.OrdinalIgnoreCase)) + return true; + return next.SupportsFlavor (guid); + } + + internal protected virtual Task<BuildResult> OnRunTarget (ProgressMonitor monitor, string target, ConfigurationSelector configuration) + { + return next.OnRunTarget (monitor, target, configuration); + } + + internal protected virtual bool OnGetSupportsTarget (string target) + { + return next.OnGetSupportsTarget (target); + } + + internal protected virtual void OnGetProjectTypes (HashSet<string> types) + { + next.OnGetProjectTypes (types); + } + + internal protected virtual void OnReadProject (ProgressMonitor monitor, MSBuildProject msproject) + { + next.OnReadProject (monitor, msproject); + } + + internal protected virtual void OnReadConfiguration (ProgressMonitor monitor, ProjectConfiguration config, IMSBuildPropertySet pset) + { + next.OnReadConfiguration (monitor, config, pset); + } + + internal protected virtual void OnWriteProject (ProgressMonitor monitor, MSBuildProject msproject) + { + next.OnWriteProject (monitor, msproject); + } + + internal protected virtual void OnWriteConfiguration (ProgressMonitor monitor, ProjectConfiguration config, IMSBuildPropertySet pset) + { + next.OnWriteConfiguration (monitor, config, pset); + } + + #region Building + + internal protected virtual bool OnGetIsCompileable (string fileName) + { + return next.OnGetIsCompileable (fileName); + } + + internal protected virtual string OnGetDefaultBuildAction (string fileName) + { + return next.OnGetDefaultBuildAction (fileName); + } + + internal protected virtual string OnGetDefaultResourceId (ProjectFile projectFile) + { + return next.OnGetDefaultResourceId (projectFile); + } + + internal protected virtual IEnumerable<string> OnGetStandardBuildActions () + { + return next.OnGetStandardBuildActions (); + } + + internal protected virtual IList<string> OnGetCommonBuildActions () + { + return next.OnGetCommonBuildActions (); + } + + internal protected virtual ProjectItem OnCreateProjectItem (IMSBuildItemEvaluated item) + { + return next.OnCreateProjectItem (item); + } + + internal protected virtual void OnPopulateSupportFileList (FileCopySet list, ConfigurationSelector configuration) + { + next.OnPopulateSupportFileList (list, configuration); + } + + internal protected virtual void OnPopulateOutputFileList (List<FilePath> list, ConfigurationSelector configuration) + { + next.OnPopulateOutputFileList (list, configuration); + } + + internal protected virtual FilePath OnGetOutputFileName (ConfigurationSelector configuration) + { + return next.OnGetOutputFileName (configuration); + } + + internal protected virtual string[] SupportedLanguages { + get { + return next.SupportedLanguages; + } + } + + #endregion + + #region Events + + internal protected virtual void OnFileRemovedFromProject (ProjectFileEventArgs e) + { + next.OnFileRemovedFromProject (e); + } + + internal protected virtual void OnFileAddedToProject (ProjectFileEventArgs e) + { + next.OnFileAddedToProject (e); + } + + internal protected virtual void OnFileChangedInProject (ProjectFileEventArgs e) + { + next.OnFileChangedInProject (e); + } + + internal protected virtual void OnFilePropertyChangedInProject (ProjectFileEventArgs e) + { + next.OnFilePropertyChangedInProject (e); + } + + internal protected virtual void OnFileRenamedInProject (ProjectFileRenamedEventArgs e) + { + next.OnFileRenamedInProject (e); + } + + #endregion + } +} + |