//protected bool _exportRequest = false;

        //public WebImageMongoCacheManager(string server, string database, string collectionName, string directory)
        //{
        //    _server = server;
        //    _database = database;
        //    _collectionName = collectionName;
        //    _urlCache = new UrlCache(directory);
        //    _urlCache.UrlFileNameType = UrlFileNameType.Host | UrlFileNameType.Path;
        //    _urlCache.GetUrlSubDirectoryFunction = httpRequest => zurl.GetDomain(httpRequest.Url);
        //}

        public WebImageMongoCacheManager(string server, string database, string collectionName, UrlCache urlCache)
        {
            _server = server;
            _database = database;
            _collectionName = collectionName;
            _urlCache = urlCache;
        }
Example #2
0
 public static UrlCache Create(XElement xe)
 {
     if (xe != null && xe.zXPathValue("UseUrlCache").zTryParseAs(false))
     {
         UrlCache urlCache = new UrlCache(xe.zXPathExplicitValue("CacheDirectory"));
         urlCache._urlFileNameType = zurl.GetUrlFileNameType(xe.zXPathValue("CacheUrlFileNameType", "Path"));
         urlCache._saveRequest = xe.zXPathValue("CacheSaveRequest").zTryParseAs(false);
         return urlCache;
     }
     else
         return null;
 }
Example #3
0
 private static void ClassInit(XElement xe)
 {
     bool useUrlCache = xe.zXPathValue("UseUrlCache").zTryParseAs(false);
     UrlCache urlCache = null;
     if (useUrlCache)
     {
         string cacheDirectory = xe.zXPathValue("CacheDirectory");
         urlCache = new UrlCache(cacheDirectory);
         urlCache.UrlFileNameType = UrlFileNameType.Path | UrlFileNameType.Query;
         //urlCache.GetUrlSubDirectoryFunction = httpRequest => (Ebookdz_LoadPostDetailFromWebManager.GetPostDetailKey(httpRequest) / 1000 * 1000).ToString();
     }
     __currentLoadForumFromWebManager = new Ebookdz_LoadForumFromWebManager(urlCache);
 }
        //protected bool _exportRequest = false;

        //public WebImageFileCacheManager(string directory)
        //{
        //    _urlCache = new UrlCache(directory);
        //    _urlCache.UrlFileNameType = UrlFileNameType.Path | UrlFileNameType.Host;
        //    _urlCache.GetUrlSubDirectoryFunction = httpRequest => zurl.GetDomain(httpRequest.Url);
        //}

        public WebImageFileCacheManager(UrlCache urlCache)
        {
            _urlCache = urlCache;
        }
Example #5
0
 public Ebookdz_LoadForumFromWebManager(UrlCache urlCache = null)
 {
     _urlCache = urlCache;
 }
 protected void Create(XElement xe = null)
 {
     _urlCache = UrlCache.Create(xe);
     if (_urlCache != null)
         //_urlCache.GetUrlSubDirectory = httpRequest => zurl.GetDomain(httpRequest.Url);
         _urlCache.GetUrlSubDirectory = GetUrlSubDirectory;
 }
 public WebImageCacheManager_v2(UrlCache urlCache)
 {
     _urlCache = urlCache;
 }
 public WebImageCacheManager_v3(UrlCache urlCache)
 {
     UrlCache = urlCache;
 }