/// <summary> /// Add caches from an object that implements <see cref="ICacheSet"/> /// This allows maximum control over cache creation. /// </summary> /// <example> ///private class MyCacheSet : ICacheSet ///{ /// private ICacheBuilder myCacheBuilder = new MyCacheBuilder(); /// private ICacheBuilder lruBuilder = new LruCacheBuilder(); /// /// public Dictionary<CacheType, ICacheOptions> GetCacheConfiguration() /// { /// return new Dictionary<CacheType, ICacheOptions>() /// { /// { CacheType.StringsCache, new CacheOptions() { Builder = myCacheBuilder, Size = 5000 } }, /// { CacheType.NodesCache, new CacheOptions() { Builder = lruBuilder, Size = 15000 } }, /// { CacheType.ValuesCache, new CacheOptions() { Builder = lruBuilder, Size = 5000 } }, /// { CacheType.ProfilesCache, new CacheOptions() { Builder = null, Size = 600 } }, /// { CacheType.SignaturesCache, new CacheOptions() { Builder = myCacheBuilder, Size = 500 } } /// }; /// } ///} /// ///public DataSet CreateDataSet() ///{ /// return DataSetBuilder.File() /// .ConfigureCachesFromCacheSet(new MyCacheSet()) /// .Build(@"C:\datafile.dat"); ///} /// </example> /// <param name="set">The cache set to use</param> /// <returns>The <see cref="DataSetBuilder"/></returns> public T ConfigureCachesFromCacheSet(ICacheSet set) { ConfigureCaches(set.GetCacheConfiguration()); return((T)this); }