AsyncFlowControl.Undo Method

Note: This method is new in the .NET Framework version 2.0.

Restores the flow of the execution context between threads.

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)

public void Undo ()
public void Undo ()
public function Undo ()

Exception typeCondition

InvalidOperationException

The AsyncFlowControl structure is not used on the thread where it was created.

-or-

The AsyncFlowControl structure has already been used to call Undo.

The ExecutionContext.SuppressFlow method returns an AsyncFlowControl structure that is used to restore the flow.

The Undo method must be called only on the AsyncFlowControl structure returned by its associated SuppressFlow method.

The following code example shows the use of the Undo method. This example is part of a larger example provided for the ExecutionContext class.

Console.WriteLine("Restore the flow.");
aFC.Undo();
Console.WriteLine("Is the flow suppressed? " +
    ExecutionContext.IsFlowSuppressed());

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: