private DuplicateFileFinder SetupDff(IDispatcher dispatcher, IDirectory root) { Clear(); hashlookup.Clear(); var dff = new DuplicateFileFinder( dispatcher, root); dff.OnDuplicateFound += dff_OnDuplicateFound; dff.OnFileScanned += dff_OnFileScanned; dff.OnHashProgress += dff_OnHashProgress; return(dff); }
public DuplicateViewModel() { Bc = new BitMapCreator(); if (DesignerProperties.GetIsInDesignMode(new DependencyObject())) { var dff = new DuplicateFileFinder( null, new Directory(@"C:\Users\Kevin\OneDrive\duptest")); dff.FindDuplicates(); FileMapByString fm = dff._duplicates; foreach (var item in fm) { foreach (IFile file in item.Value) { dff_OnDuplicateFound(item.Key, file.Path, file.GetSize()); } } } }