/// <summary> /// 从输入框的文本转换处理后存入BodyContent /// </summary> public void FromVisualBoxText() { String s = Input; int start = s.IndexOf("<?"); while (start >= 0) { int end = s.IndexOf("/??>", start); if (end > 0) { s = s.Remove(start, end - start + 4); } else { start = -1; } } s = ConvertTagsToControls(s); //检查是否有FORM节点。 //TODO: 需要确保Control一定在Form节点中。 Regex r = new Regex(@"\<form"); Match m = r.Match(s); if (!m.Success && !IsSubTemplate) { s = "<form id=\"mainForm\" runat=\"server\">\r\n" + s; s = s + "\r\n</form>\r\n"; } bodyContent = We7Helper.FilterXMLChars(s); }
/// <summary> /// 取得模版文件的文件内容 /// </summary> /// <param name="fn"></param> public static string LoadOrignTemplate(string fn, Template t) { TemplateProcessor pa = new TemplateProcessor(); pa.FileName = fn; pa.IsSubTemplate = t.IsSubTemplate; pa.IsMasterPage = t.IsMasterPage; pa.Load(); return(We7Helper.FilterXMLChars(pa.BodyContent)); }
void LoadTemplateFromFile(string fn) { Templator pa = new Templator(); pa.FileName = fn; pa.IsSubTemplate = IsSubTemplate; pa.Load(); TemplateContentTextBox.Value = We7Helper.FilterXMLChars(pa.BodyContent); HeaderTextBox.Text = pa.HeadContent; BodyText = pa.BodyText; }