Esempio n. 1
0
        private ILogger GetCachedLogger(Type type)
        {
            Cache   cache     = HttpRuntime.Cache;
            string  cacheKey  = "ILogger::" + type.ToString();
            object  loggerObj = cache.Get(cacheKey);
            ILogger logger;

            if (loggerObj != null)
            {
                logger = (ILogger)loggerObj;
            }
            else
            {
                logger = new EventsImpl();
                cache.Insert(cacheKey, logger);
            }
            return(logger);
        }
 private ILogger GetCachedLogger(Type type)
 {
     Cache cache = HttpRuntime.Cache;
     string cacheKey = "ILogger::" + type.ToString();
     object loggerObj = cache.Get(cacheKey);
     ILogger logger;
     if (loggerObj != null)
     {
         logger = (ILogger)loggerObj;
     }
     else
     {
         logger = new EventsImpl();
         cache.Insert(cacheKey, logger);
     }
     return logger;
 }