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.Ide/MonoDevelop.Ide.Updater/UpdateService.cs | |
parent | a2046b6331a271e8203df7d3d0f14500d33d60fa (diff) |
Initial drop of the new project model
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/UpdateService.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/UpdateService.cs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/UpdateService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/UpdateService.cs index 5c4855320f..5ba90f08ef 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/UpdateService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/UpdateService.cs @@ -30,6 +30,7 @@ using System; using Mono.Addins; using MonoDevelop.Core.ProgressMonitoring; using System.Threading; +using System.Threading.Tasks; namespace MonoDevelop.Ide.Updater { @@ -128,22 +129,18 @@ namespace MonoDevelop.Ide.Updater CheckForUpdates (false); } - static void CheckForUpdates (bool automatic) + static async void CheckForUpdates (bool automatic) { PropertyService.Set ("MonoDevelop.Ide.AddinUpdater.LastCheck", DateTime.Now); PropertyService.SaveProperties (); var handlers = AddinManager.GetExtensionObjects ("/MonoDevelop/Ide/Updater/UpdateHandlers"); - IProgressMonitor mon = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor ("Looking for updates", "md-updates"); + ProgressMonitor mon = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor ("Looking for updates", "md-updates"); - Thread t = new Thread (delegate () { - CheckUpdates (mon, handlers, automatic); - }); - t.Name = "Addin updater"; - t.Start (); + await CheckUpdates (mon, handlers, automatic); } - static void CheckUpdates (IProgressMonitor monitor, object[] handlers, bool automatic) + static async Task CheckUpdates (ProgressMonitor monitor, object[] handlers, bool automatic) { using (monitor) { // The handler to use is the last one declared in the extension point @@ -151,7 +148,7 @@ namespace MonoDevelop.Ide.Updater return; try { IUpdateHandler uh = (IUpdateHandler) handlers [handlers.Length - 1]; - uh.CheckUpdates (monitor, automatic); + await uh.CheckUpdates (monitor, automatic); } catch (Exception ex) { LoggingService.LogError ("Updates check failed for handler of type '" + handlers [handlers.Length - 1].GetType () + "'", ex); } |