Click or drag to resize

TaskUtilitiesEnsureSTAThreadTaskT Method (FuncT)

If the current thread is STA, run the specified function, otherwise start an STA thread and run the function in this new thread.

Namespace:  callback.ShellBoost.Core.Utilities
Assembly:  callback.CBFSShell (in callback.CBFSShell.dll) Version: 22.0.0.0
Syntax
C#
public static Task<T> EnsureSTAThreadTask<T>(
	Func<T> func
)

Parameters

func
Type: SystemFuncT
The function.

Type Parameters

T
The return type

Return Value

Type: TaskT
An instance of the Task class.
Exceptions
ExceptionCondition
ArgumentNullExceptionfunc is null.
See Also