Skip to content

Commit

Permalink
Add a ctor with all arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
ndrwrbgs committed Dec 28, 2019
1 parent ea39af8 commit 1019e6c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/FileCache/FileCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,31 @@ public FileCache(
Init(DefaultCacheManager, calculateCacheSize, cleanInterval, false, false);
}

/// <summary>
/// Creates an instance of the file cache.
/// </summary>
/// <param name="manager"></param>
/// <param name="cacheRoot">The cache's root file path</param>
/// <param name="binder">The SerializationBinder used to deserialize cached objects. Needed if you plan
/// to cache custom objects.</param>
/// <param name="calculateCacheSize">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.
/// </param>
/// <param name="cleanInterval">If supplied, sets the interval of time that must occur between self cleans</param>
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
Expand Down

0 comments on commit 1019e6c

Please sign in to comment.