public static SiteConfigInfo GetConfig() { SiteConfigInfo config = null; if (config == null) { config = SiteConfigFileManager.LoadConfig(); } return(config); }
/// <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); }
/// <summary> /// 重设配置类实例 /// </summary> public static void ResetConfig() { m_configinfo = SiteConfigFileManager.LoadRealConfig(); }