Ejemplo n.º 1
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 (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()));
            }
            return(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// exports current map cache to GMDB file
        /// if file exsist only new records will be added
        /// otherwise file will be created and all data exported
        /// </summary>
        /// <param name="file"></param>
        /// <returns></returns>
        public bool ExportToGMDB(string file)
        {
#if SQLite
            if (PrimaryCache is SQLitePureImageCache)
            {
                StringBuilder db = new StringBuilder((PrimaryCache as SQLitePureImageCache).GtileCache);
                db.AppendFormat(CultureInfo.InvariantCulture, "{0}{1}Data.gmdb", GMapProvider.LanguageStr, Path.DirectorySeparatorChar);

                return(SQLitePureImageCache.ExportMapDataToDB(db.ToString(), file));
            }
#endif
            return(false);
        }