mirror of
https://github.com/cyanfish/naps2.git
synced 2024-09-21 04:37:47 +03:00
19 lines
524 B
C#
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));
|
|
}
|
|
} |