コード例 #1
0
ファイル: SysCacheProvider.cs プロジェクト: brianmatic/n2cms
        /// <summary>
        /// Initializes the <see cref="SysCacheProvider"/> class.
        /// </summary>
        static SysCacheProvider()
        {
            //we need to determine which cache regions are configured in the configuration file, but we cant create the 
            //cache regions at this time becasue there could be nhibernate configuration values
            //that we need for the cache regions such as connection info to be used for data dependencies, but this info 
            //isnt available until until build cache is called.  So allocte space but only create them on demand

            SysCacheSection configSection = SysCacheSection.GetSection();

            if (configSection != null && configSection.CacheRegions.Count > 0)
            {
                cacheRegionSettingsList = configSection.CacheRegions;
                cacheRegions = new Dictionary<string, SysCacheRegion>(cacheRegionSettingsList.Count);
            }
            else
            {
                cacheRegions = new Dictionary<string, SysCacheRegion>(0);
                log.Info(
                    "No cache regions specified. Cache regions can be specified in sysCache configuration section with custom settings.");
            }
        }
コード例 #2
0
        /// <summary>
        /// Initializes the <see cref="SysCacheProvider"/> class.
        /// </summary>
        static SysCacheProvider()
        {
            //we need to determine which cache regions are configured in the configuration file, but we cant create the
            //cache regions at this time becasue there could be nhibernate configuration values
            //that we need for the cache regions such as connection info to be used for data dependencies, but this info
            //isnt available until until build cache is called.  So allocte space but only create them on demand

            SysCacheSection configSection = SysCacheSection.GetSection();

            if (configSection != null && configSection.CacheRegions.Count > 0)
            {
                cacheRegionSettingsList = configSection.CacheRegions;
                cacheRegions            = new Dictionary <string, SysCacheRegion>(cacheRegionSettingsList.Count);
            }
            else
            {
                cacheRegions = new Dictionary <string, SysCacheRegion>(0);
                log.Info(
                    "No cache regions specified. Cache regions can be specified in sysCache configuration section with custom settings.");
            }
        }