示例#1
0
 private static void Serialize(SerializableCache cache)
 {
     using (var file = File.Open(Path, FileMode.OpenOrCreate))
     {
         var bf = new BinaryFormatter();
         if (cache == null)
         {
             cache = new SerializableCache(CacheVersion);
         }
         bf.Serialize(file, cache);
     }
 }
示例#2
0
 public CacheManager()
 {
     _used       = new HashSet <string>(StringComparer.InvariantCultureIgnoreCase);
     _cache      = Deserialize();
     _cacheCache = _cache;
 }