예제 #1
0
        private void OnChanged(object source, FileSystemEventArgs e)
        {
            string path = e.FullPath;

            Thread.Sleep(3000);
            bool isFile = File.Exists(path);

            if (!isFile)
            {
                return;
            }

            DangersDetection detection    = new DangersDetection();
            bool             isDangerFile = detection.detectDanger(path);

            if (!isDangerFile)
            {
                return;
            }

            bool isContained = this.dangerFiles.Contains(path);

            if (!isContained)
            {
                this.dangerFiles.Add(path);
            }
        }
예제 #2
0
        private void filesScanner()
        {
            int fileIndex              = 0;
            int dangerFilesCount       = 0;
            DangersDetection detection = new DangersDetection();

            foreach (FileDS file in this.filesForScan)
            {
                if (!this.scanning)
                {
                    break;
                }
                file.danger    = detection.detectDanger(file.path);
                file.isChecked = true;
                if (file.danger)
                {
                    dangerFilesCount += 1;
                }
                fileIndex += 1;
            }
        }