public void InitialDirectoryWalk() { CloneFinderCore.DirectoryWalker testDirectoryWalk = new CloneFinderCore.DirectoryWalker(@"C:\Users\sherman"); testDirectoryWalk.DirectoryWalkStarted += new EventHandler<CloneFinderCore.DirectoryWalkEventArgs>(DirectoryWalk_DirectoryWalkStarted); testDirectoryWalk.DirectoryWalkComplete += new EventHandler<CloneFinderCore.DirectoryWalkEventArgs>(DirectoryWalk_DirectoryWalkComplete); testDirectoryWalk.WalkDirectory(); }
public void InitialDirectoryWalk() { CloneFinderCore.DirectoryWalker testDirectoryWalk = new CloneFinderCore.DirectoryWalker(@"C:\Users\sherman"); testDirectoryWalk.DirectoryWalkStarted += new EventHandler <CloneFinderCore.DirectoryWalkEventArgs>(DirectoryWalk_DirectoryWalkStarted); testDirectoryWalk.DirectoryWalkComplete += new EventHandler <CloneFinderCore.DirectoryWalkEventArgs>(DirectoryWalk_DirectoryWalkComplete); testDirectoryWalk.WalkDirectory(); }
void backgroundWorkerSearch_DoWork(object sender, DoWorkEventArgs e) { CloneFinderCore.DirectoryWalker directoryWalk = new CloneFinderCore.DirectoryWalker(this.textBoxSearchPath.Text); directoryWalk.FileProcessed += new EventHandler<CloneFinderCore.DirectoryWalkEventArgs>(directoryWalk_FileProcessed); directoryWalk.FileAccessed += new EventHandler<CloneFinderCore.DirectoryWalkEventArgs>(directoryWalk_FileAccessed); directoryWalk.DirectoryWalkComplete += new EventHandler<CloneFinderCore.DirectoryWalkEventArgs>(directoryWalk_DirectoryWalkComplete); Collection<CloneFinderCore.ProcessedFileInfo> duplicates = directoryWalk.WalkDirectory(); e.Result = duplicates; }
void backgroundWorkerSearch_DoWork(object sender, DoWorkEventArgs e) { CloneFinderCore.DirectoryWalker directoryWalk = new CloneFinderCore.DirectoryWalker(this.textBoxSearchPath.Text); directoryWalk.FileProcessed += new EventHandler <CloneFinderCore.DirectoryWalkEventArgs>(directoryWalk_FileProcessed); directoryWalk.FileAccessed += new EventHandler <CloneFinderCore.DirectoryWalkEventArgs>(directoryWalk_FileAccessed); directoryWalk.DirectoryWalkComplete += new EventHandler <CloneFinderCore.DirectoryWalkEventArgs>(directoryWalk_DirectoryWalkComplete); Collection <CloneFinderCore.ProcessedFileInfo> duplicates = directoryWalk.WalkDirectory(); e.Result = duplicates; }
public void FindDuplicates(Options commandLineOptions) { CloneFinderCore.DirectoryWalker duplicateWalker = new CloneFinderCore.DirectoryWalker(commandLineOptions.Items[0]); if (commandLineOptions.progressIndicator) { duplicateWalker.FileProcessed += new EventHandler<CloneFinderCore.DirectoryWalkEventArgs>(duplicateWalker_FileProcessed); duplicateWalker.DirectoryWalkComplete += new EventHandler<CloneFinderCore.DirectoryWalkEventArgs>(duplicateWalker_DirectoryWalkComplete); } Collection<CloneFinderCore.ProcessedFileInfo> duplicateFiles = duplicateWalker.WalkDirectory(); WriteResults(duplicateFiles, commandLineOptions.csvOutput); }
public void FindDuplicates(Options commandLineOptions) { CloneFinderCore.DirectoryWalker duplicateWalker = new CloneFinderCore.DirectoryWalker(commandLineOptions.Items[0]); if (commandLineOptions.progressIndicator) { duplicateWalker.FileProcessed += new EventHandler <CloneFinderCore.DirectoryWalkEventArgs>(duplicateWalker_FileProcessed); duplicateWalker.DirectoryWalkComplete += new EventHandler <CloneFinderCore.DirectoryWalkEventArgs>(duplicateWalker_DirectoryWalkComplete); } Collection <CloneFinderCore.ProcessedFileInfo> duplicateFiles = duplicateWalker.WalkDirectory(); WriteResults(duplicateFiles, commandLineOptions.csvOutput); }
private void Search() { // Make sure we're searching on a valid folder if (Directory.Exists(this.textBoxSearchPath.Text)) { this.Cursor = Cursors.WaitCursor; try { this.labelStatus.Text = String.Empty; this.dataGridViewResults.DataSource = null; CloneFinderCore.DirectoryWalker directoryWalk = new CloneFinderCore.DirectoryWalker(this.textBoxSearchPath.Text); Collection <CloneFinderCore.ProcessedFileInfo> duplicates = directoryWalk.WalkDirectory(); if (duplicates != null && duplicates.Count > 0) { this.dataGridViewResults.DataSource = duplicates; this.labelStatus.Text = duplicates.Count.ToString() + " duplicate files found."; } else { MessageBox.Show("No duplicates were found in this folder.", "No duplicates", MessageBoxButtons.OK, MessageBoxIcon.Information); this.labelStatus.Text = "No duplicate files found."; } } finally { this.Cursor = Cursors.Default; } } else { MessageBox.Show("A valid folder to search has not been entered/selected.", "Invalid folder", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); if (!String.IsNullOrEmpty(this.folderBrowserDialogSearch.SelectedPath) && Directory.Exists(this.folderBrowserDialogSearch.SelectedPath)) { this.textBoxSearchPath.Text = this.folderBrowserDialogSearch.SelectedPath; } this.textBoxSearchPath.Focus(); } }
private void Search() { // Make sure we're searching on a valid folder if (Directory.Exists(this.textBoxSearchPath.Text)) { this.Cursor = Cursors.WaitCursor; try { this.labelStatus.Text = String.Empty; this.dataGridViewResults.DataSource = null; CloneFinderCore.DirectoryWalker directoryWalk = new CloneFinderCore.DirectoryWalker(this.textBoxSearchPath.Text); Collection<CloneFinderCore.ProcessedFileInfo> duplicates = directoryWalk.WalkDirectory(); if (duplicates != null && duplicates.Count > 0) { this.dataGridViewResults.DataSource = duplicates; this.labelStatus.Text = duplicates.Count.ToString() + " duplicate files found."; } else { MessageBox.Show("No duplicates were found in this folder.", "No duplicates", MessageBoxButtons.OK, MessageBoxIcon.Information); this.labelStatus.Text = "No duplicate files found."; } } finally { this.Cursor = Cursors.Default; } } else { MessageBox.Show("A valid folder to search has not been entered/selected.", "Invalid folder", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); if (!String.IsNullOrEmpty(this.folderBrowserDialogSearch.SelectedPath) && Directory.Exists(this.folderBrowserDialogSearch.SelectedPath)) { this.textBoxSearchPath.Text = this.folderBrowserDialogSearch.SelectedPath; } this.textBoxSearchPath.Focus(); } }