コード例 #1
0
        public async Task LoadGames()
        {
            QueryOptions queryOptions = new QueryOptions(CommonFileQuery.DefaultQuery, new[] { MainPage.SAVED_GAME_EXTENSION })
            {
                FolderDepth = FolderDepth.Shallow
            };

            Windows.Storage.StorageFolder folder = await StaticHelpers.GetSaveFolder();

            StorageFileQueryResult query = folder.CreateFileQueryWithOptions(queryOptions);

            System.Collections.Generic.IReadOnlyList <Windows.Storage.StorageFile> files = await query.GetFilesAsync();

            foreach (Windows.Storage.StorageFile file in files)
            {
                SavedGames.Add(file.Name);
            }
        }