System.Threading.HostExecutionContextSwitcher.Undo C# (CSharp) Method

Undo() private method

private Undo ( Object switcherObject ) : void
switcherObject Object
return void
		static public void Undo(Object switcherObject)
		{
			if (switcherObject == null) 
               return;
			// otherwise call the host
			HostExecutionContextManager hostMgr = HostExecutionContextManager.GetCurrentHostExecutionContextManager();
			if (hostMgr != null)
			{
				hostMgr.Revert(switcherObject);	
			}
		}		
	}

Usage Example

Ejemplo n.º 1
0
 public void Undo()
 {
     if (this.thread != null)
     {
         if (this.thread != Thread.CurrentThread)
         {
             throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotUseSwitcherOtherThread"));
         }
         if (this.currEC != Thread.CurrentThread.GetExecutionContextNoCreate())
         {
             throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_SwitcherCtxMismatch"));
         }
         this.scsw.Undo();
         try
         {
             HostExecutionContextSwitcher.Undo(this.hecsw);
         }
         finally
         {
             this.sysw.Undo();
         }
         Thread.CurrentThread.SetExecutionContext(this.prevEC);
         this.thread = null;
     }
 }
All Usage Examples Of System.Threading.HostExecutionContextSwitcher::Undo
HostExecutionContextSwitcher