//// =========================================================================================================== //// Constructors //// =========================================================================================================== public ThreadDispatcher( ThreadInvokerFunc uiThreadInvoker, ThreadInvokerFunc backgroundThreadInvoker = null, AsyncThreadInvokerFunc backgroundAsyncThreadInvoker = null, DelayInvokerFunc delayInvoker = null) { _uiThreadInvoker = uiThreadInvoker ?? throw new ArgumentNullException(nameof(uiThreadInvoker)); _backgroundThreadInvoker = backgroundThreadInvoker ?? Task.Run; _backgroundAsyncThreadInvoker = backgroundAsyncThreadInvoker ?? Task.Run; _delayInvoker = delayInvoker ?? Task.Delay; }
//// =========================================================================================================== //// Constructors //// =========================================================================================================== public UnitTestThreadDispatcher( ThreadInvokerFunc uiThreadInvoker = null, ThreadInvokerFunc backgroundThreadInvoker = null, AsyncThreadInvokerFunc backgroundAsyncThreadInvoker = null, DelayInvokerFunc delayInvoker = null) : base( uiThreadInvoker ?? RunAction, backgroundThreadInvoker ?? RunAction, backgroundAsyncThreadInvoker ?? RunActionAsync, delayInvoker ?? DontDelay) { }