CodePlexProject Hosting for Open Source Software
An unexpected error has occured.
There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
Voted
No files are attached
ghstahl wrote Nov 26, 2012 at 8:47 PM
TypeCacheSerializer serializer = new TypeCacheSerializer(); bool shouldUseCache = ShouldUseCache(); List<Type> matchingTypes; if (shouldUseCache) { // first, try reading from the cache on disk matchingTypes = ReadTypesFromCache(cacheName, predicate, buildManager, serializer); if (matchingTypes != null) { return matchingTypes; } } // if reading from the cache failed, enumerate over every assembly looking for a matching type matchingTypes = FilterTypesInAssemblies(buildManager, predicate).ToList(); if (shouldUseCache) { // finally, save the cache back to disk SaveTypesToCache(cacheName, matchingTypes, buildManager, serializer); } return matchingTypes;
ghstahl wrote Nov 26, 2012 at 8:49 PM
string settingValue = System.Configuration.ConfigurationManager.AppSettings["TypeCacheUtil:Enable"]; bool shouldUseCache; if (!String.IsNullOrEmpty(settingValue) && Boolean.TryParse(settingValue, out shouldUseCache)) { return shouldUseCache; } //defaults to true; return true;
eilonlipton wrote Feb 27 at 1:47 AM
Sign in to add a comment or to set email notifications
Keyboard shortcuts are available for this page.