diff --git a/src/FileCache/FileCache.cs b/src/FileCache/FileCache.cs index 9d3de91..64f59f7 100644 --- a/src/FileCache/FileCache.cs +++ b/src/FileCache/FileCache.cs @@ -275,6 +275,31 @@ public FileCache( Init(DefaultCacheManager, calculateCacheSize, cleanInterval, false, false); } + /// + /// Creates an instance of the file cache. + /// + /// + /// The cache's root file path + /// The SerializationBinder used to deserialize cached objects. Needed if you plan + /// to cache custom objects. + /// If true, will calcualte the cache's current size upon new object creation. + /// Turned off by default as directory traversal is somewhat expensive and may not always be necessary based on + /// use case. + /// + /// If supplied, sets the interval of time that must occur between self cleans + public FileCache( + FileCacheManagers manager, + string cacheRoot, + SerializationBinder binder, + bool calculateCacheSize = false, + TimeSpan cleanInterval = new TimeSpan() + ) + { + _binder = binder; + CacheDir = cacheRoot; + Init(manager, calculateCacheSize, cleanInterval, false, false); + } + #endregion #region custom methods