Exemplo n.º 1
0
        private void CheckSelfCompleted()
        {
            string directoryChecksum;

            lock (_lockDirFingerprint)
            {
                if (!completed) // Only do this once
                {
                    if (numberOfItemsCompleted == numberOfItems)
                    {
                        completed = true;

                        if (numberOfItemsCompleted == checksumsStored)
                        {
                            directoryChecksum = ComputeFingerprint.DirectoryChecksum(checksums);
                        }
                        else
                        {
                            string[] storedChecksums = new string[checksumsStored];
                            Array.Copy(checksums, storedChecksums, storedChecksums.Length);
                            directoryChecksum = ComputeFingerprint.DirectoryChecksum(storedChecksums);
                        }

                        RunParallelScan.progress.DirectoryCompleted(di, directoryChecksum, checksumsStored, numberOfItems);

                        // Pass checksum up to parent
                        parentFingerprint?.DirectoryCompleted(directoryChecksum);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void EmptyDirectory()
        {
            string[] EmptyDirChecksumSeed = { String.Empty };
            string   directoryChecksum;

            lock (_lockDirFingerprint)
            {
                completed         = true;
                directoryChecksum = ComputeFingerprint.DirectoryChecksum(EmptyDirChecksumSeed);

                RunParallelScan.progress.DirectoryCompleted(di, directoryChecksum, checksumsStored, numberOfItems);

                // Don't Pass empty checksum up to parent
                parentFingerprint?.ChildDirectorySkipped();
            }
        }