ThreadingTools.Apply(SynchronizationContext, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Applies the specified SynchronizationContext to the caller's context.
public static Microsoft.VisualStudio.Threading.SpecializedSyncContext Apply (this System.Threading.SynchronizationContext syncContext, bool checkForChangesOnRevert = true);
public static Microsoft.VisualStudio.Threading.SpecializedSyncContext Apply (this System.Threading.SynchronizationContext? syncContext, bool checkForChangesOnRevert = true);
static member Apply : System.Threading.SynchronizationContext * bool -> Microsoft.VisualStudio.Threading.SpecializedSyncContext
<Extension()>
Public Function Apply (syncContext As SynchronizationContext, Optional checkForChangesOnRevert As Boolean = true) As SpecializedSyncContext
Parameters
- syncContext
- SynchronizationContext
The synchronization context to apply.
- checkForChangesOnRevert
- Boolean
A value indicating whether to check that the applied SyncContext is still the current one when the original is restored.
Returns
Returns SpecializedSyncContext.