Пример #1
0
 public void DoRender(ref string content, RenderArguments args)
 {
     if (!args.IsFinished && index < Renders.Count)
     {
         Renders[index++].Render(this, ref content, args);
     }
 }
Пример #2
0
        public void Render(RenderChain renders, ref string content, RenderArguments args)
        {
            Design = !string.IsNullOrEmpty(args.Request["state"]);
            if (Design)
            {
                UserControl uc = null;

                Action = !string.IsNullOrEmpty(args.Request["action"]);
                if (Action)
                {
                    WidgetParameter = new Dictionary <string, object>();
                    var param = RequestHelper.Get <string>("params");
                    if (!string.IsNullOrEmpty(param))
                    {
                        param           = Base64Helper.Decode(param);
                        WidgetParameter = JsonConvert.DeserializeObject <Dictionary <string, object> >(param);
                    }
                }
                else
                {
                    uc       = args.Control;
                    FileName = args.Request["file"].ToString();
                }
                //执行
                //格式化代码
                content = FormatHtml(content);


                NVelocityHelper helper = new NVelocityHelper(We7.CMS.Constants.VisualTemplatePhysicalTemplateDirectory);
                helper.Put("controlId", args.Control.ID);
                helper.Put("controlName", string.Empty);
                helper.Put("controlContent", content);
                helper.Put("controlData", AttributesJsonData(args.Control));

                var rendHtml = helper.Save("We7ControlDesign.vm");

                //格式化
                content = FormatHtml(rendHtml);
            }
            renders.DoRender(ref content, args);
        }
Пример #3
0
        /// <summary>
        /// 重写信息重现
        /// </summary>
        /// <param name="writer"></param>
        protected override void Render(HtmlTextWriter writer)
        {
            RenderArguments args = new RenderArguments(this, UxParams);

            StringWriter   strWriter  = new StringWriter();
            HtmlTextWriter tempWriter = new HtmlTextWriter(strWriter);

            try
            {
                base.Render(tempWriter);
            }
            catch (Exception ex)
            {
                args.Exception = ex;
                args.IsError   = true;
            };

            string content = strWriter.ToString();

            new RenderChain().DoRender(ref content, args);
            writer.Write(content);
        }