async Task <StorageFolder> LocateSubtitlesFolder(StorageFolder startFolder, string subtitlesFolderPath) { var query = startFolder.CreateItemQuery(); query.ApplyNewQueryOptions(new QueryOptions(CommonFileQuery.DefaultQuery, VLCFileExtensions.SubtitleExtensions)); var items = await query.GetItemsAsync(); return(items.FirstOrDefault(i => i.Path.Equals(subtitlesFolderPath)) as StorageFolder); }
public LocalFolderViewModel(StorageFolder folder, PathModel parentPathModel) { CurrentFolder = folder; Path = new PathModel(folder.DisplayName, folder.Path) { Parent = parentPathModel }; _query = CurrentFolder.CreateItemQuery(); }
static List <string> GetAllFilesInDirectoryIsolatedStorage(string directory) { if (directory.Contains(IsolatedStoragePrefix)) { #if WINDOWS_8 || UWP List <string> toReturn = new List <string>(); StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; var query = localFolder.CreateItemQuery(); var result = query.GetItemsAsync().Await(); foreach (var item in result) { toReturn.Add(item.Name); } return(toReturn); #else // This is in isolated storage string[] files = mIsolatedStorageFile.GetFileNames(); for (int i = 0; i < files.Length; i++) { files[i] = IsolatedStorageToCommonFileName(files[i]); } return(new List <string>(files)); #endif } else { return(new List <string>()); } }