共用方式為


SpecializedSyncContext.Apply Method

Applies the specified SynchronizationContext to the caller's context.

Namespace:  Microsoft.VisualStudio.Threading
Assembly:  Microsoft.VisualStudio.Threading (in Microsoft.VisualStudio.Threading.dll)

Syntax

'Declaration
Public Shared Function Apply ( _
    syncContext As SynchronizationContext, _
    checkForChangesOnRevert As Boolean _
) As SpecializedSyncContext
public static SpecializedSyncContext Apply(
    SynchronizationContext syncContext,
    bool checkForChangesOnRevert
)
public:
static SpecializedSyncContext Apply(
    SynchronizationContext^ syncContext, 
    bool checkForChangesOnRevert
)
static member Apply : 
        syncContext:SynchronizationContext * 
        checkForChangesOnRevert:bool -> SpecializedSyncContext
public static function Apply(
    syncContext : SynchronizationContext, 
    checkForChangesOnRevert : boolean
) : SpecializedSyncContext

Parameters

  • checkForChangesOnRevert
    Type: System.Boolean

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

Return Value

Type: Microsoft.VisualStudio.Threading.SpecializedSyncContext
Returns SpecializedSyncContext.

.NET Framework Security

See Also

Reference

SpecializedSyncContext Structure

Microsoft.VisualStudio.Threading Namespace