JD2022-TU1/main/tools/framework/JD.Threading/Dispatch/FreeThreadDispatchStrategy.cs

43 lines
No EOL
836 B
C#

namespace JD.Threading.Dispatch
{
public class FreeThreadDispatchStrategy : IThreadDispatchStrategy
{
#region Properties
public bool InvokeRequired
{
get { return false; }
}
bool IThreadDispatchStrategy.LongOperationInvokeRequired
{
get { return false; }
}
#endregion
#region Methods
public void Dispatch(System.Action action)
{
action();
}
public void DispatchAsync(System.Action action, bool forceAsync)
{
action();
}
public void DoLongOperation(System.Action action)
{
action();
}
public void DoLongOperationAsync(System.Action action)
{
action();
}
#endregion
}
}