public static bool GetBool( string ticket, GetItemDelegateBool functor, Cache cache, TimeSpan ts, string cacheticket) { if (cache == null) { return(functor(ticket)); } string key = GetCacheKey(functor.Method.Name, cacheticket); bool flag = false; if (!TryGet(cache, key, out flag)) { flag = functor(ticket); Insert(cache, key, flag, ts); } return((bool)flag); }
public static bool GetBool <TypeArg1, TypeArg2, TypeArg3>( string ticket, TypeArg1 arg1, TypeArg2 arg2, TypeArg3 arg3, GetItemDelegateBool <TypeArg1, TypeArg2, TypeArg3> functor, Cache cache, TimeSpan ts, string cacheticket) { if (cache == null) { return(functor(ticket, arg1, arg2, arg3)); } object[] args = { arg1, arg2, arg3 }; string key = GetCacheKey(functor.Method.Name, args, cacheticket); bool flag = false; if (!TryGet(cache, key, out flag)) { flag = functor(ticket, arg1, arg2, arg3); Insert(cache, key, flag, ts); } return((bool)flag); }