Ejemplo n.º 1
0
        public BabbageMessageProvider(ITranslator translator) : base(translator)
        {
            var cacheConfig = new CacheConfig {
                Name = "appdomain.cache", Duration = 3600
            };
            var cache = new AppDomainCacheManager(cacheConfig);

            init(cache);
        }
Ejemplo n.º 2
0
        public BaseTranslator()
        {
            var cacheConfig = new CacheConfig {
                Name = "appdomain.cache", Duration = 3600
            };
            var cache = new AppDomainCacheManager(cacheConfig);

            InitInternal(cache, new NullExceptionLogger(), new NullLogger());
        }
Ejemplo n.º 3
0
        static BaseInfo()
        {
            var ccfg = new CacheConfig {
                Name = "BaseInfo", Interval = 3600, Duration = 3600
            };
            var cache    = new AppDomainCacheManager(ccfg);
            var provider = new SqlBaseInfoProvider(DA.DefaultDb, cache);

            DefaultProvider = provider;
        }
Ejemplo n.º 4
0
        private void test2()
        {
            var config = new CacheConfig {
                Name = "Locust.Test__cache"
            };
            var cache = new AppDomainCacheManager(config);

            var type = cache.Get("key1");

            System.Console.WriteLine(type != null && (type as Type) == this.GetType());
        }
Ejemplo n.º 5
0
        private void test1()
        {
            var config = new CacheConfig {
                Name = "Locust.Test__cache"
            };
            var cache = new AppDomainCacheManager(config);

            var x = cache.GetOrSet("key1", () => this.GetType());

            System.Console.WriteLine(x);
        }
Ejemplo n.º 6
0
            public override void Test()
            {
                var config = new CacheConfig {
                    Name = "Locust.Test__cache"
                };
                var cache = new AppDomainCacheManager(config);

                var prop    = cache.Get("key1", () => myClass.GetType().GetProperty("Alpha12", BindingFlags.Public | BindingFlags.Instance));
                var alpha12 = Convert.ToInt16(prop.GetValue(myClass));

                alpha12++;
            }
Ejemplo n.º 7
0
            public ICacheManager Get(object arg)
            {
                var cacheConfig = new CacheConfig
                {
                    Name                = "myCache",
                    AutoExpire          = true,
                    AutoRemoveDeadItems = true,
                    Duration            = 5
                };
                var cache = new AppDomainCacheManager(cacheConfig);

                return(cache);
            }