public async void RemoveDirectory(WallpaperDirectory directory) { ContentDialog removeDialog = new ContentDialog { Title = "Remove Directory?", Content = "Are you sure you want to remove this directory from the theme?", PrimaryButtonText = "Remove", CloseButtonText = "Cancel" }; ContentDialogResult result = await removeDialog.ShowAsync(); if (result == ContentDialogResult.Primary) { // Remove from the Lists if (directory.IsExcluded) { ExcludedWallpaperDirectories.Remove(directory); } else { WallpaperDirectories.Remove(directory); } // Delete the Directory DirectoryRepository.RemoveAndCommit(directory.ID); // Update the Cache Progress <IndicatorProgressReport> progress = new Progress <IndicatorProgressReport>(); progress.ProgressChanged += Progress_ProgressChanged; RefreshFileCache(progress); } }
public static void FullScan() { var allFiles = WallpaperDirectory.GetFiles("*", SearchOption.AllDirectories); foreach (var currentFile in allFiles) { if (WallpaperFileHelper.IsImage(currentFile)) { if (!currentFile.Name.Contains("#o")) { _ = new Wallpaper(currentFile, WallpaperCreationMode.Scan); } } } Wallpapers.Sort(); }