ThreadingTools.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
<ExtensionAttribute> _
Public Shared Function Apply ( _
syncContext As SynchronizationContext, _
checkForChangesOnRevert As Boolean _
) As SpecializedSyncContext
public static SpecializedSyncContext Apply(
this SynchronizationContext syncContext,
bool checkForChangesOnRevert
)
[ExtensionAttribute]
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
syncContext
Type: System.Threading.SynchronizationContextThe synchronization context to apply.
checkForChangesOnRevert
Type: System.Booleantrue if it should check that the applied SynchronizationContext is still the current one when the original is restored.
Return Value
Type: Microsoft.VisualStudio.Threading.SpecializedSyncContext
Returns SpecializedSyncContext.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type SynchronizationContext. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.