Browse Source

DispatcherTimer should now swallow exceptions

pull/95/head
Nikita Tsukanov 11 years ago
parent
commit
7923159c61
  1. 5
      src/Perspex.Base/Threading/Dispatcher.cs
  2. 2
      src/Perspex.Base/Threading/DispatcherTimer.cs
  3. 6
      src/Perspex.Base/Threading/MainLoop.cs

5
src/Perspex.Base/Threading/Dispatcher.cs

@ -73,9 +73,10 @@ namespace Perspex.Threading
/// Post action that will be invoked on main thread /// Post action that will be invoked on main thread
/// </summary> /// </summary>
/// <param name="action">The method.</param> /// <param name="action">The method.</param>
internal void Post(Action action) /// <param name="priority">The priority with which to invoke the method.</param>
internal void Post(Action action, DispatcherPriority priority = DispatcherPriority.Normal)
{ {
this.mainLoop.Post(action); this.mainLoop.Post(action, priority);
} }
} }
} }

2
src/Perspex.Base/Threading/DispatcherTimer.cs

@ -203,7 +203,7 @@ namespace Perspex.Threading
/// </summary> /// </summary>
private void InternalTick() private void InternalTick()
{ {
this.Dispatcher.InvokeAsync(this.RaiseTick, this.priority); this.Dispatcher.Post(this.RaiseTick, this.priority);
} }
/// <summary> /// <summary>

6
src/Perspex.Base/Threading/MainLoop.cs

@ -108,9 +108,11 @@ namespace Perspex.Win32.Threading
/// Post action that will be invoked on main thread /// Post action that will be invoked on main thread
/// </summary> /// </summary>
/// <param name="action">The method.</param> /// <param name="action">The method.</param>
internal void Post(Action action) ///
/// <param name="priority">The priority with which to invoke the method.</param>
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) private void AddJob(Job job)

Loading…
Cancel
Save