private void HandleChange() { var path = data.CurrentPath; data.GetDirectoryInfo(path); watcher.Path = path; view.Invoke(new Action(() => { view.Fill(data); })); pathTextBox.Text = data.CurrentPath; DrawBorder(); }
private void SearchByName(string wildcard, string path, CancellationToken token) { if (token.IsCancellationRequested) { return; } var browser = new DirectoryBrowser(); browser.GetDirectoryInfo(path); var matched = Array.FindAll(browser.fileList, item => MatchName(wildcard, item.Name)); foreach (var file in matched) { matchedFiles.Enqueue(file); } Parallel.ForEach(browser.dirList, new ParallelOptions { MaxDegreeOfParallelism = 3 }, dir => { SearchByName(wildcard, dir.FullName, token); }); }