Example #1
0
        /// <summary>
        /// 通过模板ID获得模板的TOHTML,并将该TmpltDoc实例加入到字典中,为Tocss做准备
        /// </summary>
        static public string GetTmpltContent(string tmpltId)
        {
            try
            {
                TmpltXmlDocument tmpltDoc = ToHtmlSdsiteService.SdsiteXmlDocument.GetTmpltDocumentById(tmpltId);
                ActiveTmpltAndSnip.AddTmpltDocIntoDictionary(tmpltDoc);

                return(tmpltDoc.ToHtml());
            }
            catch (Exception e)
            {
                ExceptionService.CreateException(e);
                return(string.Empty);
            }
        }
Example #2
0
        /// <summary>
        /// 判断该CSS为页面片,或模板CSS,找到字典中存储的实例,进行Tocss
        /// </summary>
        internal static byte[] GetCssByte(string index)
        {
            string ElementId = PathService.GetCSSGuid(index);
            string strCss    = null;

            if (ActiveTmpltAndSnip.ActiveTmpltDictionary.ContainsKey(ElementId))
            {
                strCss = "";// ActiveTmpltAndSnip.ActiveTmpltDictionary[ElementId].ToCss();
                ActiveTmpltAndSnip.DeleteTmpltDocmentDictionary(ElementId);
                return(Encoding.UTF8.GetBytes(strCss));
            }
            else if (ActiveTmpltAndSnip.ActiveSnipDictionary.ContainsKey(ElementId))
            {
                strCss = "";//ActiveTmpltAndSnip.ActiveSnipDictionary[ElementId].ToRealCss();
                ActiveTmpltAndSnip.DeleteSnipElementDictionary(ElementId);
                return(Encoding.UTF8.GetBytes(strCss));
            }
            else
            {
                return(Encoding.UTF8.GetBytes(ConstService.BAD));
            }
        }