| 1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.Threading.Tasks;
- using Avalonia.Threading;
- namespace Avalonia.UnitTests
- {
- /// <summary>
- /// Immediately invokes dispatched jobs on the current thread.
- /// </summary>
- public class ImmediateDispatcher : IDispatcher
- {
- public bool CheckAccess()
- {
- return true;
- }
- public void InvokeAsync(Action action, DispatcherPriority priority = DispatcherPriority.Normal)
- {
- action();
- }
- public Task InvokeTaskAsync(Action action, DispatcherPriority priority = DispatcherPriority.Normal)
- {
- action();
- return Task.FromResult<object>(null);
- }
- public void VerifyAccess()
- {
- }
- }
- }
|