Esempio n. 1
0
        /// <summary>
        /// triggers dynamic sqlite loading,
        /// call this before you use sqlite for other reasons than caching maps
        /// </summary>
        public void SQLitePing()
        {
#if SQLite
#if !MONO
            SQLitePureImageCache.Ping();
#endif
#endif
        }
Esempio n. 2
0
        /// <summary>
        /// imports GMDB file to current map cache
        /// only new records will be added
        /// </summary>
        /// <param name="file"></param>
        /// <returns></returns>
        public bool ImportFromGMDB(string file)
        {
#if SQLite
            if (PrimaryCache is GMap.NET.CacheProviders.SQLitePureImageCache)
            {
                StringBuilder db = new StringBuilder((PrimaryCache as SQLitePureImageCache).GtileCache);
                db.AppendFormat(CultureInfo.InvariantCulture, "{0}{1}Data.gmdb", GMapProvider.LanguageStr, Path.DirectorySeparatorChar);

                return(SQLitePureImageCache.ExportMapDataToDB(file, db.ToString()));
            }
#endif
            return(false);
        }
Esempio n. 3
0
        /// <summary>
        /// optimizes map database, *.gmdb
        /// </summary>
        /// <param name="file">database file name or null to optimize current user db</param>
        /// <returns></returns>
        public bool OptimizeMapDb(string file)
        {
            if (PrimaryCache is GMap.NET.CacheProviders.SQLitePureImageCache)
            {
                if (string.IsNullOrEmpty(file))
                {
                    StringBuilder db = new StringBuilder((PrimaryCache as SQLitePureImageCache).GtileCache);
                    db.AppendFormat(CultureInfo.InvariantCulture, "{0}{1}Data.gmdb", GMapProvider.LanguageStr, Path.DirectorySeparatorChar);

                    return(SQLitePureImageCache.VacuumDb(db.ToString()));
                }
                else
                {
                    return(SQLitePureImageCache.VacuumDb(file));
                }
            }

            return(false);
        }