private void DeleteSelected()
        {
            ScanHelper.DeleteDirectories(GetSelectedDirectories());
            ScanHelper.DeleteFiles(GetSelectedFiles());

            contentsLabel.Content = $"Count: {newFilesListBox.Items.Count}";

            selectedFilesListBox.Items.Clear();
        }
Exemplo n.º 2
0
        private async Task DeleteContents()
        {
            var files          = ScanHelper.GetFiles(SourceDir, keywords: Keywords);
            var subDirectories = ScanHelper.GetSubDirectories(SourceDir, excludeEmpty: ExcludeEmptyDirectories);

            if (Frequency == FrequencyEnum.AfterDays)
            {
                files          = ScanHelper.FilterFilesByAge(DayLimit, files);
                subDirectories = ScanHelper.FilterDirectoriesByAge(DayLimit, subDirectories);
            }

            ScanHelper.DeleteFiles(files);
            ScanHelper.DeleteDirectories(subDirectories);
        }