public async Task <bool> Remove(ICacheChip <BitmapImage> chip)
        {
            if (this._cacheIndexs.ContainsKey(chip.HashKey))
            {
                await chip.Reset();

                _cacheIndexs.Remove(chip.HashKey);
            }
            return(true);
        }
Exemple #2
0
 public bool IsValid(ICacheChip <T> chip)
 {
     if (!_cacheIndexs.ContainsKey(chip.HashKey))
     {
         return(false);
     }
     else if (_cacheIndexs.ContainsKey(chip.HashKey) && DateTime.Now > _cacheIndexs[chip.HashKey].ExpirationTime)
     {
         chip.Reset();
         _cacheIndexs.Remove(chip.HashKey);
         return(false);
     }
     else
     {
         return(true);
     }
 }