internal RuleCache <T> GetRuleCache <T>() where T : class { // make sure we have cache. var cache = TypeHelper.LazyCreateNew(ref Cache); object ruleCache; lock (cache) { if (!cache.TryGetValue(typeof(T), out ruleCache)) { cache[typeof(T)] = ruleCache = new RuleCache <T>(); } } return((RuleCache <T>)ruleCache); }
internal RuleCache <T> GetRuleCache <T>() where T : class { object obj2; if (this.Cache == null) { Interlocked.CompareExchange <Dictionary <Type, object> >(ref this.Cache, new Dictionary <Type, object>(), null); } Dictionary <Type, object> cache = this.Cache; lock (cache) { if (!cache.TryGetValue(typeof(T), out obj2)) { cache[typeof(T)] = obj2 = new RuleCache <T>(); } } return(obj2 as RuleCache <T>); }
internal RuleCache <T> GetRuleCache <T>() where T : class { // make sure we have cache. if (Cache == null) { Interlocked.CompareExchange(ref Cache, new Dictionary <Type, object>(), null); } object ruleCache; var cache = Cache; lock (cache) { if (!cache.TryGetValue(typeof(T), out ruleCache)) { cache[typeof(T)] = ruleCache = new RuleCache <T>(); } } RuleCache <T> result = ruleCache as RuleCache <T>; Debug.Assert(result != null); return(result); }
public static void MoveRule <T>(RuleCache <T> cache, T rule, int i) { }
public static T[] GetCachedRules <T>(RuleCache <T> cache) { Contract.Requires(cache != null); return(default(T[])); }
public static T[] GetCachedRules <T>(RuleCache <T> cache) where T : class { return(cache.GetRules()); }
public static T[] GetCachedRules <T>(RuleCache <T> cache) { throw new NotImplementedException(); }
public static void MoveRule <T>(RuleCache <T> cache, T rule, int i) { throw new NotImplementedException(); }