/// <summary> /// Folder Picker /// </summary> /// <param name="suggestedStartLocation"></param> /// <param name="fileTypeFilters"></param> /// <returns>FolderInfoM</returns> public override async Task <FolderInfoM> GetFolderAsync(CFPickerLocationId suggestedStartLocation, IList <string> fileTypeFilters) { var folderPicker = new FolderPicker { SuggestedStartLocation = (PickerLocationId)Enum.Parse(typeof(PickerLocationId), ((int)suggestedStartLocation).ToString()) }; foreach (string item in fileTypeFilters) { folderPicker.FileTypeFilter.Add(item); } var folder = await folderPicker.PickSingleFolderAsync(); if (folder == null) { return(null); } var folderInfo = new FolderInfoM { StorageFolder = folder, FolderName = folder.DisplayName, Path = folder.Path, Token = Cipher.encrypt(folder.Path), }; StorageApplicationPermissions.FutureAccessList.AddOrReplace(folderInfo.Token, folder); return(folderInfo); }
public abstract Task<FolderInfoM> GetFolderAsync(CFPickerLocationId suggestedStartLocation, IList<string> fileTypeFilters);
/// <summary> /// Folder Picker /// </summary> /// <param name="suggestedStartLocation"></param> /// <param name="fileTypeFilters"></param> /// <returns>FolderInfoM</returns> public override async Task<FolderInfoM> GetFolderAsync(CFPickerLocationId suggestedStartLocation, IList<string> fileTypeFilters) { var folderPicker = new FolderPicker { SuggestedStartLocation = (PickerLocationId) Enum.Parse(typeof (PickerLocationId), ((int) suggestedStartLocation).ToString()) }; foreach (string item in fileTypeFilters) { folderPicker.FileTypeFilter.Add(item); } var folder = await folderPicker.PickSingleFolderAsync(); if (folder == null) return null; var folderInfo = new FolderInfoM { StorageFolder = folder, FolderName = folder.DisplayName, Path = folder.Path, Token = Cipher.encrypt(folder.Path), }; StorageApplicationPermissions.FutureAccessList.AddOrReplace(folderInfo.Token, folder); return folderInfo; }
public abstract Task <FolderInfoM> GetFolderAsync(CFPickerLocationId suggestedStartLocation, IList <string> fileTypeFilters);