static MothAction() { // default cacheprovider uses aspnet cache CacheProvider = new AspNetCacheProvider(); // register the default executors RegisterExecutor(new CssExecutor()); RegisterExecutor(new ScriptExecutor()); RegisterExecutor(new OutputSubstitutionExecutor()); }
public static T GetFromCache <T>(this IOutputCacheProvider provider, string key, Func <T> fetchAction, TimeSpan duration) where T : class { var obj = provider.Get <T>(key); // gotta change this, we'll have to add some <nil> value or something, as this is going to break one day if (obj == null) { obj = fetchAction(); provider.Store(key, obj, duration); } return(obj); }
static ScriptExecutor() { HashingInstance = new MurmurHash2UInt32Hack(); Provider = MothAction.CacheProvider; }
/// <summary> /// Initialize the MothAction (do this in global.asax) with a custom Provider /// </summary> /// <param name="provider"></param> public static void Initialize(IOutputCacheProvider provider) { CacheProvider = provider; }
static DataUriHelper() { Provider = MothAction.CacheProvider; Random = new Random(); }
public ResourcesController() { _provider = MothAction.CacheProvider; }
static OutputSubstitutionHelper() { Provider = MothAction.CacheProvider; }
static MothInlineScriptWrapper() { Provider = MothAction.CacheProvider; }
static MothSupportExtensions() { Provider = MothAction.CacheProvider; }
public CssTidy() { _provider = MothAction.CacheProvider; _filename = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "csstidy.exe"); }