Exemplo n.º 1
0
 /// <summary>
 /// 初始化
 /// </summary>
 /// <param name="tplPath"></param>
 /// <param name="tplNameAsTemplateId"></param>
 public void Register(string tplPath, bool tplNameAsTemplateId)
 {
     if (Settings.loaded)
     {
         try
         {
             //初始化模板
             global::JR.DevFw.Template.Config.EnabledCache = true;
             //模板设置是否缓存
             global::JR.DevFw.Template.Config.EnabledCompress = Settings.TPL_UseCompress;
             tpl = new TemplateRegister(tplPath, tplNameAsTemplateId ?
                                        TemplateNames.FileName : TemplateNames.ID);
             //将配置写入模板缓存
             RegisterTemplate();
         }
         catch (Exception ex)
         {
             HttpRuntime.UnloadAppDomain();
             throw ex;
         }
     }
     else
     {
         HttpRuntime.UnloadAppDomain();
         throw new ApplicationException("请在系统加载配置后再进行初始化!");
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="tplPath"></param>
        /// <param name="tplNameAsTemplateId"></param>
        public void Register(string tplPath, bool tplNameAsTemplateId)
        {
            if (Settings.loaded)
            {
                try
                {
                    //初始化模板
                    global::AtNet.DevFw.Template.Config.EnabledCache = true;

                    //模板设置是否缓存
                    global::AtNet.DevFw.Template.Config.EnabledCompress = Settings.TPL_UseCompress;

                    tpl = new TemplateRegister(tplPath,
                                               tplNameAsTemplateId ? TemplateNames.FileName : TemplateNames.ID
                                               );

                    //将配置写入模板缓存
                    RegisterTemplate();


                    //重置栏目

                    //
                    //UNDONE : INIT
                    //


                    /*
                     * new CategoryBLL().RebuildCache();
                     *
                     * //重建模块缓存
                     * WeakRefCache.RebuiltModule();
                     */
                }
                catch (Exception ex)
                {
                    HttpRuntime.UnloadAppDomain();
                    throw ex;
                }
            }
            else
            {
                HttpRuntime.UnloadAppDomain();
                throw new ApplicationException("请在系统加载配置后再进行初始化!");
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="tplPath"></param>
        /// <param name="tplNameAsTemplateId"></param>
        public void Register(string tplPath, bool tplNameAsTemplateId)
        {
            if (Settings.loaded)
            {
                try
                {
                    //初始化模板
                    global::Ops.Template.Config.EnabledCache = true;

                    //模板设置是否缓存
                    global::Ops.Template.Config.EnabledCompress = Settings.TPL_UseCompress;

                    tpl = new TemplateRegister(tplPath,
                                                tplNameAsTemplateId ? TemplateNames.FileName : TemplateNames.ID
                                                );

                    //将配置写入模板缓存
                    RegisterTemplate();


                    //重置栏目

                    //
                    //UNDONE : INIT
                    //


                    /*
                     new CategoryBLL().RebuildCache();

                     //重建模块缓存
                     WeakRefCache.RebuiltModule();
                     */

                }
                catch (Exception ex)
                {
                    HttpRuntime.UnloadAppDomain();
                    throw ex;
                }
            }
            else
            {
                HttpRuntime.UnloadAppDomain();
                throw new ApplicationException("请在系统加载配置后再进行初始化!");
            }

        }