示例#1
0
        void LoadFromMap()
        {
            string tmpfolder = CDHelper.Config.DefaultTemplateGroupFileName;

            tmpfolder = tmpfolder.Remove(tmpfolder.IndexOf("."));
            tmpfolder = Path.Combine(HttpContext.Current.Server.MapPath("~/" + CDHelper.Config.SiteSkinsBasePath), tmpfolder + ".map");
            if (File.Exists(tmpfolder))
            {
                TemplateMap          tm = new TemplateMap(tmpfolder);
                Channel              ch = ChannelHelper.GetChannel(ChannelID, null);
                ChannelTemplateGroup cg = tm.GetChannelTemplate(ch.FullUrl);
                if (cg != null)
                {
                    TemplateIDTextBox.Text       = cg.IndexTemplate;
                    DetailTemplateIDTextBox.Text = cg.DetailTemplate;
                    ListTemplateIDTextBox.Text   = cg.ListTemplate;
                    SearchTemplateIDTextBox.Text = cg.SearchTemplate;
                    indexCheckbox.Checked        = cg.IndexInherit;
                    listCheckbox.Checked         = cg.ListInherit;
                    detailCheckbox.Checked       = cg.DetailInherit;
                    searchCheckbox.Checked       = cg.SearchInherit;
                }
            }
            else
            {
                ShowInfomation();
            }
        }
示例#2
0
        void SaveToMapFile()
        {
            ChannelTemplateGroup cg = new ChannelTemplateGroup();

            cg.IndexTemplate  = TemplateIDTextBox.Text;
            cg.DetailTemplate = DetailTemplateIDTextBox.Text;
            cg.ListTemplate   = ListTemplateIDTextBox.Text;
            cg.SearchTemplate = SearchTemplateIDTextBox.Text;
            cg.IndexInherit   = indexCheckbox.Checked;
            cg.ListInherit    = listCheckbox.Checked;
            cg.DetailInherit  = detailCheckbox.Checked;
            cg.SearchInherit  = searchCheckbox.Checked;

            string tmpfolder = CDHelper.Config.DefaultTemplateGroupFileName;

            tmpfolder = tmpfolder.Remove(tmpfolder.IndexOf("."));
            tmpfolder = Path.Combine(HttpContext.Current.Server.MapPath("~/" + CDHelper.Config.SiteSkinsBasePath), tmpfolder + ".map");
            Channel ch = ChannelHelper.GetChannel(ChannelID, null);

            TemplateMap.SaveToTemplateMapFile(cg, ch.FullUrl, tmpfolder);
            TemplateMap.ResetInstance();
        }