Sdílet prostřednictvím


JoinableTaskContext Constructors

Definition

Overloads

JoinableTaskContext()

Initializes a new instance of the JoinableTaskContext class assuming the current thread is the main thread and Current will provide the means to switch to the main thread from another thread.

JoinableTaskContext(Thread, SynchronizationContext)

Initializes a new instance of the JoinableTaskContext class.

JoinableTaskContext()

Initializes a new instance of the JoinableTaskContext class assuming the current thread is the main thread and Current will provide the means to switch to the main thread from another thread.

public:
 JoinableTaskContext();
public:
 JoinableTaskContext();
 JoinableTaskContext();
public JoinableTaskContext ();
Public Sub New ()

Applies to

JoinableTaskContext(Thread, SynchronizationContext)

Initializes a new instance of the JoinableTaskContext class.

public JoinableTaskContext (System.Threading.Thread mainThread = default, System.Threading.SynchronizationContext synchronizationContext = default);
public JoinableTaskContext (System.Threading.Thread? mainThread = default, System.Threading.SynchronizationContext? synchronizationContext = default);
new Microsoft.VisualStudio.Threading.JoinableTaskContext : System.Threading.Thread * System.Threading.SynchronizationContext -> Microsoft.VisualStudio.Threading.JoinableTaskContext
Public Sub New (Optional mainThread As Thread = Nothing, Optional synchronizationContext As SynchronizationContext = Nothing)

Parameters

mainThread
Thread

The thread to switch to in SwitchToMainThreadAsync(CancellationToken). If omitted, the current thread will be assumed to be the main thread.

synchronizationContext
SynchronizationContext

The synchronization context to use to switch to the main thread.

Applies to