示例#1
0
        /// <summary>
        /// Reset the metastrings database
        /// Only used internally for testing, should not be used in a production environment
        /// </summary>
        /// <param name="reset">Reset request object</param>
        public void Reset(bool includeNameValues = false)
        {
            if (includeNameValues)
            {
                NameValues.Reset(Ctxt);
            }
            else
            {
                Items.Reset(Ctxt);
            }

            NameValues.ClearCaches();
        }
示例#2
0
        public static Context GetCtxt() // start from scratch
        {
            string dbFilePath = Context.DbConnStrToFilePath("Data Source=[UserRoaming]/metastrings-tests.db");

            if (File.Exists(dbFilePath))
            {
                File.Delete(dbFilePath);
            }

            var ctxt = new Context("Data Source=" + dbFilePath);

            NameValues.Reset(ctxt);
            return(ctxt);
        }