SHARE
TWEET

Untitled

a guest Sep 20th, 2019 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  void EnclosingMethod(bool outerVariable1, //1refint nonOuterVariable) //2
  2. {
  3.   int outerVariable2 = 10; //3string capturedVariable = "captured"; //4if (outerVariable2 % 2 == 0)
  4.   {
  5.     int normalLocalVariable = 5; //5
  6.     Console.WriteLine("Normal local variable: {0}", normalLocalVariable);
  7.   }
  8.  
  9.   WaitCallback d =
  10.     delegate(object o)
  11.     {
  12.       int anonymousMethodLocalVariable = 12; //6
  13.       Console.WriteLine("Captured variable is {0}", capturedVariable);
  14.     };
  15.  
  16.   ThreadPool.QueueUserWorkItem(d, null);
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top