Ejemplo n.º 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = Directory?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (FileName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (CompletePath?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ Size.GetHashCode();
         hashCode = (hashCode * 397) ^ CreationTime.GetHashCode();
         hashCode = (hashCode * 397) ^ LastWriteTime.GetHashCode();
         hashCode = (hashCode * 397) ^ LastAccessTime.GetHashCode();
         return(hashCode);
     }
 }
        public override int GetHashCode()
        {
            unchecked
            {
                int hashCode = Directory != null?Directory.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (FileName != null ? FileName.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (CompletePath != null ? CompletePath.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Size.GetHashCode();
                hashCode = (hashCode * 397) ^ CreationTime.GetHashCode();
                hashCode = (hashCode * 397) ^ LastWriteTime.GetHashCode();
                hashCode = (hashCode * 397) ^ LastAccessTime.GetHashCode();
                return(hashCode);
            }
        }
Ejemplo n.º 3
0
        private void Scan_Click(object sender, RoutedEventArgs e)
        {
            var currentPaths = CompletePath.Select(_ => _.Path);
            var search       = new SearchOperation("C:\\", 4, new ScanningWindow());

            Task <IEnumerable <string> > .Factory.StartNew(search.Run).ContinueWith(task => {
                if (task.IsFaulted)
                {
                    return;                 // Too bad
                }
                var binDirectories = task.Result;

                binDirectories
                .Select(PathEntry.FromFilePath)
                .Where(path => !currentPaths.Contains(path))
                .Each(path => UserPath.Add(new AnnotatedPathEntry(path)));
            }, TaskScheduler.FromCurrentSynchronizationContext());
        }
Ejemplo n.º 4
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;
            }
        }
Ejemplo n.º 5
0
 public override int GetHashCode()
 {
     return(CompletePath.GetHashCode());
 }