public static void RemoveSelectedFiles(RemoveCase removeCase, string FolderPath, string leftMatch, string rightMatch) { string leftImageFile = $"{FolderPath}\\{leftMatch}"; string rightImageFile = $"{FolderPath}\\{rightMatch}"; if (!File.Exists(leftImageFile) || !File.Exists(rightImageFile)) { return; } string leftTempImageFile = $"{FolderPath}\\TempFolder\\{leftMatch}"; string rightTempImageFile = $"{FolderPath}\\TempFolder\\{rightMatch}"; switch (removeCase) { case RemoveCase.Left: File.Move(leftImageFile, leftTempImageFile); break; case RemoveCase.Right: File.Move(rightImageFile, rightTempImageFile); break; case RemoveCase.Both: File.Move(leftImageFile, leftTempImageFile); File.Move(rightImageFile, rightTempImageFile); break; case RemoveCase.FalsePositive: break; } }
private void RemoveMatchFromLV(RemoveCase removeCase) { if (this.DuplImagesListView.Items.Count == 0 || this.DuplImagesListView.SelectedItems.Count == 0) { return; } FoldingHelpers.CheckTemp(this.FolderPath, this.TempOfRemoved); string leftMatch = DuplImagesListView.SelectedItems[0].SubItems[0].Text; string rightMatch = DuplImagesListView.SelectedItems[0].SubItems[1].Text; this.LeftDuplPictureBox.Image = null; this.RightDuplPictureBox.Image = null; this.DuplImagesListView.SelectedItems[0].Remove(); FoldingHelpers.RemoveSelectedFiles(removeCase, this.FolderPath, leftMatch, rightMatch); this.TempOfRemoved.Add(leftMatch, rightMatch); }