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.Extensions/ProjectExtensionUtil.cs | |
parent | a2046b6331a271e8203df7d3d0f14500d33d60fa (diff) |
Initial drop of the new project model
Diffstat (limited to 'main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectExtensionUtil.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectExtensionUtil.cs | 48 |
1 files changed, 6 insertions, 42 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectExtensionUtil.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectExtensionUtil.cs index 6004da536e..926dcf07e8 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectExtensionUtil.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectExtensionUtil.cs @@ -30,6 +30,7 @@ using System.IO; using System.Collections.Generic; using System.Threading; using MonoDevelop.Core; +using System.Threading.Tasks; namespace MonoDevelop.Projects.Extensions { @@ -43,28 +44,13 @@ namespace MonoDevelop.Projects.Extensions loadControlSlot = Thread.AllocateDataSlot (); } - public static ISolutionItemHandler GetItemHandler (SolutionItem item) - { - return item.GetItemHandler (); - } - - public static void InstallHandler (ISolutionItemHandler handler, SolutionItem item) - { - item.SetItemHandler (handler); - } - - public static SolutionEntityItem LoadSolutionItem (IProgressMonitor monitor, string fileName, ItemLoadCallback callback) + public async static Task<SolutionItem> LoadSolutionItem (ProgressMonitor monitor, string fileName, ItemLoadCallback callback) { using (Counters.ReadSolutionItem.BeginTiming ("Read project " + fileName)) { - return Services.ProjectService.GetExtensionChain (null).LoadSolutionItem (monitor, fileName, callback); + return await Services.ProjectService.GetExtensionChain (null).LoadSolutionItem (monitor, fileName, callback); } } - - public static BuildResult Compile (IProgressMonitor monitor, SolutionEntityItem item, BuildData buildData, ItemCompileCallback callback) - { - return Services.ProjectService.GetExtensionChain (item).Compile (monitor, item, buildData, callback); - } - + public static void BeginLoadOperation () { Interlocked.Increment (ref loading); @@ -94,28 +80,6 @@ namespace MonoDevelop.Projects.Extensions if (op != null) op.Add (rc); } - - public static string EncodePath (SolutionEntityItem item, string path, string oldPath) - { - IPathHandler ph = item.GetItemHandler () as IPathHandler; - if (ph != null) - return ph.EncodePath (path, oldPath); - else { - string basePath = Path.GetDirectoryName (item.FileName); - return FileService.RelativeToAbsolutePath (basePath, path); - } - } - - public static string DecodePath (SolutionEntityItem item, string path) - { - IPathHandler ph = item.GetItemHandler () as IPathHandler; - if (ph != null) - return ph.DecodePath (path); - else { - string basePath = Path.GetDirectoryName (item.FileName); - return FileService.AbsoluteToRelativePath (basePath, path); - } - } } class LoadOperation @@ -141,7 +105,7 @@ namespace MonoDevelop.Projects.Extensions - public delegate SolutionEntityItem ItemLoadCallback (IProgressMonitor monitor, string fileName); + public delegate Task<SolutionItem> ItemLoadCallback (ProgressMonitor monitor, string fileName); - public delegate BuildResult ItemCompileCallback (IProgressMonitor monitor, SolutionEntityItem item, BuildData buildData); + public delegate BuildResult ItemCompileCallback (ProgressMonitor monitor, SolutionItem item, BuildData buildData); } |