diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2014-01-20 19:32:53 +0400 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@xamarin.com> | 2014-10-21 18:39:14 +0400 |
commit | f73b2a9990495587d514aa1856919c21170a3940 (patch) | |
tree | 9842411ee8644ead5915a715ee7e53984a601df4 /main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownSolutionItem.cs | |
parent | a2046b6331a271e8203df7d3d0f14500d33d60fa (diff) |
Initial drop of the new project model
Diffstat (limited to 'main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownSolutionItem.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownSolutionItem.cs | 54 |
1 files changed, 23 insertions, 31 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownSolutionItem.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownSolutionItem.cs index 08d8697279..9ab6a3102b 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownSolutionItem.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownSolutionItem.cs @@ -28,10 +28,11 @@ using System; using MonoDevelop.Core; +using System.Threading.Tasks; namespace MonoDevelop.Projects { - public class UnknownSolutionItem: SolutionEntityItem + public class UnknownSolutionItem: SolutionItem { string loadError = string.Empty; bool unloaded; @@ -41,7 +42,15 @@ namespace MonoDevelop.Projects public UnknownSolutionItem () { + Initialize (this); NeedsReload = false; + IsUnsupportedProject = true; + } + + public override bool SupportsConfigurations () + { + // The item is unknown, but we still want to read/write its configurations + return true; } public override FilePath FileName { @@ -70,48 +79,30 @@ namespace MonoDevelop.Projects loadError = GettextCatalog.GetString ("Unavailable"); } } - - public override string Name { - get { - if (!FileName.IsNullOrEmpty) - return FileName.FileNameWithoutExtension; - else - return GettextCatalog.GetString ("Unknown entry"); - } - set { } - } - internal protected override bool OnGetSupportsTarget (string target) + protected override string OnGetName () { - return false; + if (!FileName.IsNullOrEmpty) + return FileName.FileNameWithoutExtension; + else + return GettextCatalog.GetString ("Unknown entry"); } - - protected override void OnClean (IProgressMonitor monitor, ConfigurationSelector configuration) + + protected override Task<BuildResult> OnClean (ProgressMonitor monitor, ConfigurationSelector configuration) { + return Task.FromResult (BuildResult.Success); } - protected override BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration) + protected override Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration) { var r = new BuildResult (); r.AddError ("Project unavailable"); - return r; - } - - protected internal override void OnExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration) - { - } - - protected internal override bool OnGetNeedsBuilding (ConfigurationSelector configuration) - { - return false; - } - - protected internal override void OnSetNeedsBuilding (bool value, ConfigurationSelector configuration) - { + return Task.FromResult (r); } - protected internal override void OnSave (IProgressMonitor monitor) + protected internal override Task OnSave (ProgressMonitor monitor) { + return Task.FromResult (0); } } @@ -119,6 +110,7 @@ namespace MonoDevelop.Projects { public UnloadedSolutionItem () { + Initialize (this); UnloadedEntry = true; } } |