From 8ebc2e3392d31438ae3cd17ac12031edfd76bcf6 Mon Sep 17 00:00:00 2001 From: Lluis Sanchez Gual Date: Wed, 22 Apr 2015 11:20:34 +0200 Subject: [Core] Add new overridable to Project Added method for checking if a build action is a compilation build action. --- .../MonoDevelop.Core/MonoDevelop.Projects/Project.cs | 20 ++++++++++++++++++++ .../MonoDevelop.Projects/ProjectExtension.cs | 5 +++++ 2 files changed, 25 insertions(+) diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs index 918762f797..efa8b59602 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs @@ -365,6 +365,21 @@ namespace MonoDevelop.Projects return false; } + /// + /// Determines whether the provided build action is a compile action + /// + /// true if this instance is compile build action the specified buildAction; otherwise, false. + /// Build action. + public bool IsCompileBuildAction (string buildAction) + { + return ProjectExtension.OnGetIsCompileBuildAction (buildAction); + } + + protected virtual bool OnGetIsCompileBuildAction (string buildAction) + { + return buildAction == BuildAction.Compile; + } + /// /// Files of the project /// @@ -2435,6 +2450,11 @@ namespace MonoDevelop.Projects return Project.OnGetIsCompileable (fileName); } + internal protected override bool OnGetIsCompileBuildAction (string buildAction) + { + return Project.OnGetIsCompileBuildAction (buildAction); + } + internal protected override void OnGetTypeTags (HashSet types) { Project.OnGetTypeTags (types); diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs index cd8d3d4a75..83f0dbb5ea 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs @@ -127,6 +127,11 @@ namespace MonoDevelop.Projects return next.OnGetIsCompileable (fileName); } + internal protected virtual bool OnGetIsCompileBuildAction (string buildAction) + { + return next.OnGetIsCompileBuildAction (buildAction); + } + internal protected virtual string OnGetDefaultBuildAction (string fileName) { return next.OnGetDefaultBuildAction (fileName); -- cgit v1.2.3