From 7923159c6123c05d3bb15370df834d0cd9f8044e Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Thu, 3 Sep 2015 22:05:42 +0300 Subject: [PATCH] DispatcherTimer should now swallow exceptions --- src/Perspex.Base/Threading/Dispatcher.cs | 5 +++-- src/Perspex.Base/Threading/DispatcherTimer.cs | 2 +- src/Perspex.Base/Threading/MainLoop.cs | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Perspex.Base/Threading/Dispatcher.cs b/src/Perspex.Base/Threading/Dispatcher.cs index e9b91f9ab9..d959151543 100644 --- a/src/Perspex.Base/Threading/Dispatcher.cs +++ b/src/Perspex.Base/Threading/Dispatcher.cs @@ -73,9 +73,10 @@ namespace Perspex.Threading /// Post action that will be invoked on main thread /// /// The method. - internal void Post(Action action) + /// The priority with which to invoke the method. + internal void Post(Action action, DispatcherPriority priority = DispatcherPriority.Normal) { - this.mainLoop.Post(action); + this.mainLoop.Post(action, priority); } } } \ No newline at end of file diff --git a/src/Perspex.Base/Threading/DispatcherTimer.cs b/src/Perspex.Base/Threading/DispatcherTimer.cs index 73335ea408..0d49bb21f8 100644 --- a/src/Perspex.Base/Threading/DispatcherTimer.cs +++ b/src/Perspex.Base/Threading/DispatcherTimer.cs @@ -203,7 +203,7 @@ namespace Perspex.Threading /// private void InternalTick() { - this.Dispatcher.InvokeAsync(this.RaiseTick, this.priority); + this.Dispatcher.Post(this.RaiseTick, this.priority); } /// diff --git a/src/Perspex.Base/Threading/MainLoop.cs b/src/Perspex.Base/Threading/MainLoop.cs index b4941118ae..3a99133d15 100644 --- a/src/Perspex.Base/Threading/MainLoop.cs +++ b/src/Perspex.Base/Threading/MainLoop.cs @@ -108,9 +108,11 @@ namespace Perspex.Win32.Threading /// Post action that will be invoked on main thread /// /// The method. - internal void Post(Action action) + /// + /// The priority with which to invoke the method. + internal void Post(Action action, DispatcherPriority priority) { - this.AddJob(new Job(action, DispatcherPriority.Normal, true)); + this.AddJob(new Job(action, priority, true)); } private void AddJob(Job job)