public void SearchAA(FindAA f, string dName) { this.Enabled = true; f.Close(); string data = f.DATA; if (data != null) { string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + Path.DirectorySeparatorChar + Path.GetFileName(dName) + "_LICHNYE_DANNIE" + @".txt"; using (StreamWriter file = new StreamWriter(path, false, Encoding.UTF8)) { file.WriteLine(data); } } }
private void WhichSearch(string path, StreamWriter file) { WhichFindPD window = new WhichFindPD(); string which; if (window.ShowDialog() == DialogResult.OK) { which = window.ITEM; switch (which) { case "Thread": { SearhThread(path, file); break; } case "Parallel.ForEach": { SearcParallelForEach(path, file); break; } case "Tasks": { SearchTasks(path, file); break; } case "Async/await": { FindAA wind = new FindAA(this, path); this.Enabled = false; wind.Show(); wind.Search(path); break; } default: break; } } }