예제 #1
0
        /// <summary>
        /// Really only for testing. Will delete the db! All gone! No recovery!
        /// </summary>
        /// <returns></returns>
        public static async Task DeleteDB()
        {
            try
            {
                SQLiteDb.Forget();
                GC.Collect();
                var f = await StorageFile.GetFileFromPathAsync(SQLiteDb.DBPath);

                await f.DeleteAsync();

                return;
            }
            catch (FileNotFoundException) {
                return;
            }
            catch (UnauthorizedAccessException)
            {
            }

            // We couldn't delete the file, so we should re-create everything.
            await SQLiteDb.ResetTables();
        }