testit() メソッドはクロージャです。aString は範囲外ですが、testit() は引き続き実行できます。testit2() は、スコープ (mystring) から外れていないが、testit2() にも渡されていない変数を使用しています。testit2() は閉鎖と見なされますか?
string mystring = "hello world";
Action testit = new Action(delegate { string aString = "in anon method"; Debug.WriteLine(aString); });
testit();
//capture mystring. Is this still a closure?
Action testit2 = new Action(delegate { Debug.WriteLine(mystring); });
//mystring is still in scope
testit2();
2 番目の例では、mystring はメソッドの外部で更新でき、それらの変更は testit2() に反映されます。これは、mystring をパラメーターとしてキャプチャすることしかできない通常の方法とは異なります。