コード例 #1
0
        /// <summary>
        /// Returns the number of books read; clears out the original books and saves.
        /// </summary>
        /// <returns></returns>
        public static async Task <int> ReadDirAsync(BookDataContext bookdb)
        {
            var picker = new FolderPicker()
            {
                SuggestedStartLocation = PickerLocationId.DocumentsLibrary,
            };

            picker.FileTypeFilter.Add(".rdf");
            var folder = await picker.PickSingleFolderAsync();

            if (folder == null)
            {
                return(-1);
            }
            NextIndexLogged = LogNIndex;

            NRead = 0;
            CommonQueries.BookRemoveAll(bookdb);
            await ReadDirAsyncFolder(bookdb, folder);

            CommonQueries.BookSaveChanges(bookdb);
            var totlog = logsb.ToString();

            return(NRead);
        }