public ViewModel_DuplicateChecker() { this.IsMove = true; if (base.IsInDesignMode) { FileOperationPanelShow = true; DupplicateCollection.Add(new Model_DuplicateChecker() { FileDetails = new Model_DuplicateChecker_FileDetails() { Filename = "win.com", Fullfilepath = "c:\\windows\\win.com", ParentDirectory = "c:\\windows" }, Hash = "12345" }); DupplicateCollection.Add(new Model_DuplicateChecker() { FileDetails = new Model_DuplicateChecker_FileDetails() { Filename = "ackack.com", Fullfilepath = "c:\\windows\\ackack.com", ParentDirectory = "c:\\windows\\system32" }, Hash = "12345" }); DupplicateCollection.Add(new Model_DuplicateChecker() { FileDetails = new Model_DuplicateChecker_FileDetails() { Filename = "command.com", Fullfilepath = "c:\\windows\\command.com", ParentDirectory = "c:\\windows" }, Hash = "67890" }); DupplicateCollection.Add(new Model_DuplicateChecker() { FileDetails = new Model_DuplicateChecker_FileDetails() { Filename = "com.com", Fullfilepath = "c:\\windows\\com.com", ParentDirectory = "c:\\windows\\system32" }, Hash = "67890" }); ProgressText = "Status Text"; } else { this.EnableSelectFolder = true; this.EnableScanFolder = true; this.EnableRemoveDuplicates = true; FileOperationPanelShow = true; this.Command_Start = new RelayCommand(Command_Start_Click); this.Command_CheckDuplicate = new RelayCommand(Command_CheckDuplicate_Click); this.Command_ShowDupTab = new RelayCommand(Command_ShowDupTab_Click); this.Command_ShowPrefWindow = new RelayCommand(Command_ShowPrefWindow_Click); this.Command_CloseWindow = new RelayCommand(Command_CloseWindow_Click); this.Command_Cancel = new RelayCommand(Command_Cancel_Click); } }
public async void Command_Start_Click() { if (this.DupplicateCollection.Where(dc => dc.Selected == true).Count() == this.DupplicateCollection.Count()) { if (MessageBox.Show("You are about to delete all the files. Are you sure that you want to continue?", "mCleaner", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No) { return; } } await Task.Run(() => CommandLogic_DuplicateChecker.I.Start(this.DupplicateCollection, IsMove ? 1 : 0)); DupplicateCollection.Clear(); this.EnableRemoveDuplicates = false; }
public void Command_ShowDupTab_Click() { CleanerML.Run = false; CleanerML.ShowCleanerDescription = false; CleanerML.btnCleanNowPreviousState = CleanerML.btnPreviewCleanEnable; CleanerML.btnPreviewCleanEnable = false; CleanerML.btnCleaningOptionsEnable = false; CleanerML.ShowFrontPage = false; this.EnableRemoveDuplicates = false; if (Settings.Default.DupChecker_CustomPath != null && Settings.Default.DupChecker_CustomPath.Count > 0) { this.EnableScanFolder = true; } else { this.EnableScanFolder = false; } DupplicateCollection.Clear(); this.ShowWindow = true; ProgressText = string.Empty; }