public override BinaryStorageData GetResourceData(string key)
 {
     if (HttpContext.Current.Cache != null)
     {
         BinaryStorageData data = (BinaryStorageData)HttpContext.Current.Cache[key];
         if (data != null)
         {
             HttpContext.Current.Cache.Remove(key);
         }
         return(data);
     }
     return(null);
 }
Пример #2
0
 public override void StoreResourceData(ASPxWebControlBase control, string key, BinaryStorageData data)
 {
     ClearFileCacheIfNeeded(GetFolderPath());
     using (FileStream stream = new FileStream(GetFilePath(key), FileMode.OpenOrCreate))
         stream.Write(data.Content, 0, data.Content.Length);
 }
 public override void StoreResourceData(ASPxWebControlBase control, string key, BinaryStorageData data)
 {
     HttpContext.Current.Cache.Add(key, data, null, Cache.NoAbsoluteExpiration,
         TimeSpan.FromMinutes(1), CacheItemPriority.NotRemovable, null);
 }
 public override void StoreResourceData(ASPxWebControlBase control, string key, BinaryStorageData data)
 {
     HttpContext.Current.Cache.Add(key, data, null, Cache.NoAbsoluteExpiration,
                                   TimeSpan.FromMinutes(1), CacheItemPriority.NotRemovable, null);
 }