任何大 量使用了匿名方法的项目,在升级到Visual Studio 2008时,有可能无法保持代码分析的清洁性。
The bad news is that any project making heavy use of anonymous methods is likely no longer Code Analysis clean on its upgrade to Visual Studio 2008.
使用匿名方法时,代码风格应该和普通方法一样,与委托声明对齐。(大括号应该放到新的一行里)。
With anonymous methods, mimic the code layout of a regular method, aligned with the delegate declaration. (complies with placing an open curly brace in a new line).
当匿名方法使用局部变量的值时,将在执行匿名方法时获取该值。
When an anonymous method USES the value of a local variable, the value is obtained at the moment the anonymous method is executed.
应用推荐