System.Threading.AsyncFlowControl.Setup C# (CSharp) Method

Setup() private method

private Setup ( ) : void
return void
        internal void Setup()
        {
            useEC = true;
            _ec = Thread.CurrentThread.ExecutionContext;
            _ec.isFlowSuppressed = true;
            _thread = Thread.CurrentThread;
        }
        

Same methods

AsyncFlowControl::Setup ( SecurityContextDisableFlow flags ) : void

Usage Example

 public static AsyncFlowControl SuppressFlow()
 {
     if (IsFlowSuppressed())
     {
         throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotSupressFlowMultipleTimes"));
     }
     AsyncFlowControl afc = new AsyncFlowControl();
     afc.Setup();
     return afc;
 }
All Usage Examples Of System.Threading.AsyncFlowControl::Setup