hownot2code.com
How to capture a variable in C# and not to shoot yourself in the foot
Back in 2005, with the release of C# 2.0 standard we got a possibility to pass a variable to the body of an anonymous delegate by capturing it from the current context. In 2008 the C# 3.0 brought u…