示例#1
0
        public static SiteConfigInfo GetConfig()
        {
            SiteConfigInfo config = null;

            if (config == null)
            {
                config = SiteConfigFileManager.LoadConfig();
            }
            return(config);
        }
示例#2
0
        /// <summary>
        /// 获取当前站点配置
        /// </summary>
        /// <returns></returns>
        public static SiteConfigInfo GetConfig()
        {
            //if (m_configinfo == null)
            //{
            //    lock (lockHelper)
            //    {
            //        if (m_configinfo == null)
            //        {
            //            m_configinfo = SiteConfigFileManager.LoadConfig();
            //        }
            //    }
            //}
            //return m_configinfo;

            string         configid = "siteconfig";
            SiteConfigInfo config   = AppCtx.Cache.RetrieveObject <SiteConfigInfo>(configid);

            if (config == null)
            {
                config = SiteConfigFileManager.LoadConfig();
                AppCtx.Cache.AddObjectWithFileChange(configid, config, ConfigFile);
            }
            return(config);
        }
示例#3
0
 /// <summary>
 /// 重设配置类实例
 /// </summary>
 public static void ResetConfig()
 {
     m_configinfo = SiteConfigFileManager.LoadRealConfig();
 }