public static Cache Load()
{
try
{
if (File.Exists)
{
using (FileStream fs = File.OpenRead())
using (DeflateStream deflate = new DeflateStream(fs, CompressionMode.Decompress))
{
return new Cache((CacheSurrogate)Serializer.Deserialize(fs));
}
}
else
{
return null;
}
}
catch
{
return null;
}
}
Cache::Load ( Stream stream, bool leaveOpen = false ) : |
private void OnCache() { using (MemoryStream mem = new MemoryStream(BodyBuffer)) { Local.Cache = Cache.Load(mem); } Local.CommitCache(); }