访问修改后的闭包string [] files = new string[2];files[0] = "ThinkFarAhead.Example.Settings.Configuration_Local.xml";
files[1] = "ThinkFarAhead.Example.Settings.Configuration_Global.xml";
//Resharper complains this is an "access to modified closure"for (int i = 0; i < files.Length; i++ ){
// Resharper disable AccessToModifiedClosure
if(Array.Exists(Assembly.GetExecutingAssembly().GetManifestResourceNames(),
delegate(string name) { return name.Equals(files[i]); }))
return Assembly.GetExecutingAssembly().GetManifestResourceStream(files[i]);
// ReSharper restore AccessToModifiedClosure}虽然ReSharper抱怨说这是“访问修改后的闭包”,但上面的内容似乎很好。有人能说明这件事吗?
- 3 回答
- 0 关注
- 539 浏览
添加回答
举报
0/150
提交
取消