public async Task LoadFolderAsync(string path, ThumbnailFetchOptions thumbnailOptions = default) { if (thumbnailOptions == default) { this.thumbnailOptions = new ThumbnailFetchOptions(); } else { this.thumbnailOptions = thumbnailOptions; } s.Restart(); browseCts?.Cancel(); //Cancel previously scheduled browse browseCts = new CancellationTokenSource(); //Create new cancel token for this request deepSearchRunning = false; //Current load might be a deep search so stop it folderQueryOptions.FolderDepth = FolderDepth.Shallow; fileQueryOptions.FolderDepth = FolderDepth.Shallow; if (currentPath == path) { await ReloadFolderAsync(path, browseCts.Token); } else { await SwitchFolderAsync(path, browseCts.Token); } }
public async Task LoadFolderDeepAsync(string path, ThumbnailFetchOptions thumbnailOptions = default) { if (thumbnailOptions == default) { this.thumbnailOptions = new ThumbnailFetchOptions(); } else { this.thumbnailOptions = thumbnailOptions; } s.Restart(); browseCts?.Cancel(); //Cancel previously scheduled browse browseCts = new CancellationTokenSource(); //Create new cancel token for this request folderQueryOptions.FolderDepth = FolderDepth.Deep; //Request any subfolders fileQueryOptions.FolderDepth = FolderDepth.Deep; //Request any files in subfolders deepSearchRunning = true; if (currentPath == path) { await ReloadFolderAsync(path, browseCts.Token); } else { await SwitchFolderAsync(path, browseCts.Token); } }
public async Task RefetchThumbnails(ThumbnailFetchOptions thumbnailOptions = default) { this.thumbnailOptions = thumbnailOptions; for (int i = 0; i < files.Count; i++) { if (browseCts.Token.IsCancellationRequested) { break; } var ti = await files[i].GetThumbnailAsync(thumbnailOptions.Mode, thumbnailOptions.Size, thumbnailOptions.Scale); if (ti != null) { try { await ViewItems[folderCount + i].Image.SetSourceAsync(ti.CloneStream()); } catch (Exception) { /*Supress Task canceled exception*/ } } } }
public async void LoadFolder(FileSystemElement fse, ThumbnailFetchOptions thumbnailOptions) { await retrieveService.LoadFolderAsync(fse.Path, thumbnailOptions); }
public async void RefetchThumbnails(ThumbnailFetchOptions thumbnailOptions) { await retrieveService.RefetchThumbnails(thumbnailOptions); }