Browse Source

Method renaming

pull/261/head
Nikita Tsukanov 11 years ago
parent
commit
17f90128c9
  1. 4
      src/Perspex.Base/Threading/Dispatcher.cs
  2. 2
      src/Perspex.Base/Threading/DispatcherTimer.cs
  3. 4
      src/Perspex.Base/Threading/PerspexSynchronizationContext.cs
  4. 2
      src/Perspex.Controls/Platform/ITopLevelRenderer.cs
  5. 2
      src/Perspex.Controls/TopLevel.cs

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

@ -58,7 +58,7 @@ namespace Perspex.Threading
/// <param name="action">The method.</param>
/// <param name="priority">The priority with which to invoke the method.</param>
/// <returns>A task that can be used to track the method's execution.</returns>
public Task InvokeTask(Action action, DispatcherPriority priority = DispatcherPriority.Normal)
public Task InvokeTaskAsync(Action action, DispatcherPriority priority = DispatcherPriority.Normal)
{
return _jobRunner.InvokeAsync(action, priority);
}
@ -68,7 +68,7 @@ namespace Perspex.Threading
/// </summary>
/// <param name="action">The method.</param>
/// <param name="priority">The priority with which to invoke the method.</param>
public void Invoke(Action action, DispatcherPriority priority = DispatcherPriority.Normal)
public void InvokeAsync(Action action, DispatcherPriority priority = DispatcherPriority.Normal)
{
_jobRunner.Post(action, priority);
}

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

@ -177,7 +177,7 @@ namespace Perspex.Threading
/// </summary>
private void InternalTick()
{
Dispatcher.UIThread.Invoke(RaiseTick, _priority);
Dispatcher.UIThread.InvokeAsync(RaiseTick, _priority);
}
/// <summary>

4
src/Perspex.Base/Threading/PerspexSynchronizationContext.cs

@ -36,14 +36,14 @@ namespace Perspex.Threading
/// <inheritdoc/>
public override void Post(SendOrPostCallback d, object state)
{
Dispatcher.UIThread.Invoke(() => d(state));
Dispatcher.UIThread.InvokeAsync(() => d(state));
}
/// <inheritdoc/>
public override void Send(SendOrPostCallback d, object state)
{
// TODO: Add check for being on the main thread, we should invoke the method immediately in this case
Dispatcher.UIThread.InvokeTask(() => d(state)).Wait();
Dispatcher.UIThread.InvokeTaskAsync(() => d(state)).Wait();
}
}
}

2
src/Perspex.Controls/Platform/ITopLevelRenderer.cs

@ -44,7 +44,7 @@ namespace Perspex.Controls.Platform
}));
resources.Add(queueManager.RenderNeeded.Subscribe(_
=>
Dispatcher.UIThread.Invoke(() => topLevel.PlatformImpl.Invalidate(new Rect(topLevel.ClientSize)))));
Dispatcher.UIThread.InvokeAsync(() => topLevel.PlatformImpl.Invalidate(new Rect(topLevel.ClientSize)))));
topLevel.PlatformImpl.Paint = rect =>
{

2
src/Perspex.Controls/TopLevel.cs

@ -365,7 +365,7 @@ namespace Perspex.Controls
/// </summary>
private void HandleLayoutNeeded()
{
Dispatcher.UIThread.Invoke(LayoutManager.ExecuteLayoutPass, DispatcherPriority.Render);
Dispatcher.UIThread.InvokeAsync(LayoutManager.ExecuteLayoutPass, DispatcherPriority.Render);
}
/// <summary>

Loading…
Cancel
Save