标签:des 使用 io for ar cti new ad
public void run(Action<List<string>> onload)
{
List<string> directoryLists = new List<string>();
directoryLists = Directory.GetDirectories(m_importPath).ToList();
Parallel.ForEach(directoryLists,new ParallelOptions { MaxDegreeOfParallelism=10}, i =>
{
List<string> files = importer(i);
onload(files);
}
}
Action<List<string>> onload = dir =>
{
BeginInvoke(new EventHandler((obj, even) =>
{
var root = new TreeNode(dir[0]);
for (int i = 1; i < dir.Count; i++)
{
string fileName = dir[i].Substring(dir[i].LastIndexOf(‘\\‘) + 1);
root.Nodes.Add(fileName.Remove(fileName.IndexOf(‘.‘)));
}
this.treeView1.Nodes.Add(root);
}), null);
};
import.run(onload);
标签:des 使用 io for ar cti new ad
原文地址:http://www.cnblogs.com/zhaowei303/p/3909522.html