naps2/NAPS2.Sdk/Threading/Invoker.cs

19 lines
524 B
C#

namespace NAPS2.Threading;
// TODO: Can we get rid of this static context?
/// <summary>
/// Synchronized access to the UI thread.
/// </summary>
public static class Invoker
{
private static IInvoker _current = new DefaultInvoker();
/// <summary>
/// Gets or sets the current implementation of synchronized access to the UI thread.
/// </summary>
public static IInvoker Current
{
get => _current;
set => _current = value ?? throw new ArgumentNullException(nameof(value));
}
}