System.Threading.ExecutionContext.SuppressFlow Method

Suppresses the flow of the execution context across asynchronous threads.

Syntax

public static AsyncFlowControl SuppressFlow ()

Returns

An System.Threading.AsyncFlowControl structure for restoring the flow.

Remarks

Use this method to suppress the flow of the System.Threading.ExecutionContext on the current thread.

You must use the AsyncFlowControl.Undo method on the returned System.Threading.AsyncFlowControl structure to restore the flow of the System.Threading.ExecutionContext.

This method is protected with a System.Security.Permissions.SecurityAction.LinkDemand for System.Security.Permissions.SecurityPermissionFlag.Infrastructure permission. A fully trusted component can call this method to suppress the flow of the System.Threading.ExecutionContext during asynchronous calls. While the flow is suppressed, the System.Security.SecurityContext.Capture method returns null.

Requirements

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0