protected BaseStorageCache(IsolatedStorageFile isf, string cacheDirectory, ICacheFileNameGenerator cacheFileNameGenerator, long cacheMaxLifetimeInMillis = DefaultCacheMaxLifetimeInMillis)
{
if (isf == null)
{
throw new ArgumentNullException("isf");
}
if (String.IsNullOrEmpty(cacheDirectory))
{
throw new ArgumentException("cacheDirectory name could not be null or empty");
}
if (!cacheDirectory.StartsWith("\\"))
{
throw new ArgumentException("cacheDirectory name should starts with double slashes: \\");
}
if (cacheFileNameGenerator == null)
{
throw new ArgumentNullException("cacheFileNameGenerator");
}
ISF = isf;
CacheDirectory = cacheDirectory;
CacheFileNameGenerator = cacheFileNameGenerator;
CacheMaxLifetimeInMillis = cacheMaxLifetimeInMillis;
// Creating cache directory if it not exists
ISF.CreateDirectory(CacheDirectory);
}