Esempio n. 1
0
        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>);
        }
Esempio n. 3
0
        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[]));
        }
Esempio n. 6
0
 public static T[] GetCachedRules <T>(RuleCache <T> cache) where T : class
 {
     return(cache.GetRules());
 }
Esempio n. 7
0
 public static T[] GetCachedRules <T>(RuleCache <T> cache)
 {
     throw new NotImplementedException();
 }
Esempio n. 8
0
 public static void MoveRule <T>(RuleCache <T> cache, T rule, int i)
 {
     throw new NotImplementedException();
 }