예제 #1
0
        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();
        }
예제 #2
0
        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);
            });
        }