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
SynchronizationContextThe synchronization context to apply.
checkForChangesOnRevert
boolA value indicating whether to check that the applied SyncContext is still the current one when the original is restored.
Returns
Dispose()
Reverts the SynchronizationContext to its previous instance.
public void Dispose()