/// <summary> /// Carga la configuración a partir de <paramref name="section"/> /// </summary> /// <param name="section">Sección de configuración del archivo de configuración</param> private static void LoadConfigurationFromConfigurationSection(CachingSection section) { foreach (CachePolicyElement policyElement in section.PolicyCollection) { CachePolicyConfiguration policyConf = new CachePolicyConfiguration() { Name = policyElement.Name, CacheType = policyElement.CacheType, DefaultLifeTime = policyElement.DefaultLifeTime, CacheMemoryLimitMegabytes = policyElement.CacheMemoryLimitMegabytes, PhysicalMemoryLimitPercentage = policyElement.PhysicalMemoryLimitPercentage, PollingInterval = policyElement.PollingInterval }; CacheConfigurationManager._policyConfigurationList.Add(policyConf); } }
/// <summary> /// Carga los datos de propiedades de cache del archivo de configuración /// <see cref="PerformanceCounterContainer"/> /// </summary> internal static void Initialize() { _policyConfigurationList = new List <CachePolicyConfiguration>(); try { section = ConfigurationManager.GetSection(_cachingSectionName) as CachingSection; } catch (ConfigurationErrorsException ceex) { throw new CacheException(Messages.CacheLoadError, ceex); } if (section == null) { throw new CacheException(Messages.CacheLoadError); } else { LoadConfigurationFromConfigurationSection(section); } _traceSource = new TraceSource("AlemanaCachingSource", SourceLevels.All); }