Table of Contents

Struct SpecializedSyncContext

Namespace
Microsoft.VisualStudio.Threading
Assembly
Microsoft.VisualStudio.Threading.dll

A structure that applies and reverts changes to the SynchronizationContext.

public readonly struct SpecializedSyncContext : IDisposable
Implements
Inherited Members

Methods

Apply(SynchronizationContext?, bool)

Applies the specified SynchronizationContext to the caller's context.

public static SpecializedSyncContext Apply(SynchronizationContext? syncContext, bool checkForChangesOnRevert = true)

Parameters

syncContext SynchronizationContext

The synchronization context to apply.

checkForChangesOnRevert bool

A value indicating whether to check that the applied SyncContext is still the current one when the original is restored.

Returns

SpecializedSyncContext

Dispose()

Reverts the SynchronizationContext to its previous instance.

public void Dispose()