GMap.NET.Core/GMap.NET.CacheProviders/MSSQLCEPureImageCache.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。


namespace GMap.NET.CacheProviders
{
#if !SQLite
   using System;
   using System.Data;
   using System.Diagnostics;
   using System.IO;
   using SqlCommand = System.Data.SqlServerCe.SqlCeCommand;
   using SqlConnection = System.Data.SqlServerCe.SqlCeConnection;

   /// <summary>
   /// image cache for ms sql server
   /// </summary>
   internal class MsSQLCePureImageCache : PureImageCache, IDisposable
   {
      string cache;
      string gtileCache;

      /// <summary>
      /// local cache location
      /// </summary>
      public string CacheLocation
      {
         get
         {
            return cache;
         }
         set
         {
            cache = value;
            gtileCache = cache + "TileDBv3" + Path.DirectorySeparatorChar + GMaps.Instance.LanguageStr + Path.DirectorySeparatorChar;
         }
      }

      SqlCommand cmdInsert;
      SqlCommand cmdFetch;
      SqlConnection cnGet;
      SqlConnection cnSet;

      /// <summary>
      /// is cache initialized
      /// </summary>
      public volatile bool Initialized = false;

      /// <summary>
      /// inits connection to server
      /// </summary>
      /// <returns></returns>
      public bool Initialize()
      {
         if(!Initialized)
         {
            #region prepare mssql & cache table
            try
            {
               // precrete dir
               if(!Directory.Exists(gtileCache))
               {
                  Directory.CreateDirectory(gtileCache);
后面还有 194 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。