async public static void copyFolder(StorageFolder from, StorageFolder _to) { StorageFolder to = await _to.CreateFolderAsync(from.Name, CreationCollisionOption.OpenIfExists); IReadOnlyList<StorageFile> storageFiles = await from.GetFilesAsync(); foreach (var storageFile in storageFiles) { await storageFile.CopyAsync(to, storageFile.Name, NameCollisionOption.ReplaceExisting); } //IReadOnlyList<StorageFolder> storageFolders = await from.GetFoldersAsync(); var queryResult = from.CreateFolderQuery(); IReadOnlyList<StorageFolder> storageFolders = await queryResult.GetFoldersAsync(); foreach (var storageFolder in storageFolders) { copyFolder(storageFolder, to); } }
async Task LoadImagesFromDisk(StorageFolder currentFolder) { if (currentFolder.Name == "Cloud") { return; } var subFolderQuery = currentFolder.CreateFolderQuery(); var folders = await subFolderQuery.GetFoldersAsync(); //Get the files out of the current folder await processImageFiles(currentFolder); //Find any sub folders foreach (var folder in folders) { await LoadImagesFromDisk(folder); } }