private void LoadBtn_Click(object sender, EventArgs e) { if (loadthread != null) { return; } var name = (string)TextureList.SelectedItem; IFileProvider prov; if (Directory.Exists(Path.Combine(ImgPath, name))) { prov = new DirProvider(new DirectoryInfo(Path.Combine(ImgPath, name))); } else if (File.Exists(Path.Combine(ImgPath, name + ".zip"))) { prov = new ZipProvider(new FileStream(Path.Combine(ImgPath, name + ".zip"), FileMode.Open, FileAccess.Read)); } else { SetText("Not found"); return; } loadthread = new Thread(loadfunc); loadthread.Start(prov); }
private void LoadBtn_Click(object sender, EventArgs e) { if (loadthread != null) return; var name = (string)TextureList.SelectedItem; IFileProvider prov; if (Directory.Exists(Path.Combine(ImgPath, name))) { prov = new DirProvider(new DirectoryInfo(Path.Combine(ImgPath, name))); } else if (File.Exists(Path.Combine(ImgPath, name + ".zip"))) { prov = new ZipProvider(new FileStream(Path.Combine(ImgPath, name + ".zip"), FileMode.Open, FileAccess.Read)); } else { SetText("Not found"); return; } loadthread = new Thread(loadfunc); loadthread.Start(prov); }