Пример #1
0
        public static ICache GetCacheProvider(ICache iProviderDocument, Enumerations.Cache cacheType)
        {
            ICacheDependency dependency = new HttpCacheDependency();

            dependency.CacheFile    = CacheFile;
            dependency.CacheRefresh = CacheRefresh;
            switch (cacheType)
            {
            case Enumerations.Cache.Http:
                if (iProviderDocument == null)
                {
                    iProviderDocument = (ICache)Activator.CreateInstance(typeof(HttpCacheAdapter), dependency);
                }
                break;

            default:
                if (iProviderDocument == null)
                {
                    iProviderDocument = (ICache)Activator.CreateInstance(typeof(HttpCacheAdapter), dependency);
                }
                break;
            }
            return(iProviderDocument);
        }
Пример #2
0
 public ICache GetInstance(Enumerations.Cache cacheType)
 {
     _IProviderCache = Utilities.GetCacheProvider(_IProviderCache, cacheType);
     return(_IProviderCache);
 }