Exemplo n.º 1
0
        private void Scan_Click(object sender, RoutedEventArgs e)
        {
            var currentPaths = CompletePath.Select(_ => _.Path);

            var window = new ScanningWindow();
            var search = new SearchOperation("C:\\", 4, window);

            Task <IEnumerable <string> > .Factory.StartNew(search.Run);

            if (window.ShowDialog() == true)
            {
                UserPath.SupressNotification = true;
                search.Result
                .Select(PathEntry.FromFilePath)
                .Where(path => !currentPaths.Contains(path))
                .Each(path => UserPath.Add(new AnnotatedPathEntry(path)));
                UserPath.SupressNotification = false;
            }
        }
Exemplo n.º 2
0
        private void Scan_Click(object sender, RoutedEventArgs e)
        {
            var currentPaths = CompletePath.Select(_ => _.Path);

            var window = new ScanningWindow();
            var search = new SearchOperation("C:\\", 4, window);

            Task<IEnumerable<string>>.Factory.StartNew(search.Run);
            if (window.ShowDialog() == true)
            {
                UserPath.SupressNotification = true;
                search.Result
                    .Select(PathEntry.FromFilePath)
                    .Where(path => !currentPaths.Contains(path))
                    .Each(path => UserPath.Add(new AnnotatedPathEntry(path)));
                UserPath.SupressNotification = false;
            }
        }