public void ModifyAsset() { Parallel.ForEach(_assetfiles, file => { var extension = Path.GetExtension(file); AssetHandler handler = null; if (_extension_handler.TryGetValue(extension, out handler)) { handler.Invoke(file); } }); }
public void ModfiyAsset(string file) { var extension = Path.GetExtension(file); AssetHandler handler = null; if (_extension_handler.TryGetValue(extension, out handler)) { return; } Parallel.ForEach(_assetfiles, asset => { var filename = Path.GetFileName(asset); if (filename != file) { return; } handler.Invoke(file); }); }