Esempio n. 1
0
        public static void ParseInnerContent(StringBuilder parsedBuilder, PageInfo pageInfo, ContextInfo contextInfo)
        {
            var isInnerElement = contextInfo.IsInnerElement;

            contextInfo.IsInnerElement = true;
            StlElementParser.ReplaceStlElements(parsedBuilder, pageInfo, contextInfo);
            StlEntityParser.ReplaceStlEntities(parsedBuilder, pageInfo, contextInfo);
            contextInfo.IsInnerElement = isInnerElement;
        }
Esempio n. 2
0
        public static void ParseTemplateContent(StringBuilder parsedBuilder, PageInfo pageInfo, ContextInfo contextInfo)
        {
            var isInnerElement = contextInfo.IsInnerElement;

            contextInfo.IsInnerElement    = false;
            contextInfo.ContainerClientId = string.Empty;
            StlElementParser.ReplaceStlElements(parsedBuilder, pageInfo, contextInfo);
            StlEntityParser.ReplaceStlEntities(parsedBuilder, pageInfo, contextInfo);
            contextInfo.IsInnerElement = isInnerElement;
        }
Esempio n. 3
0
        public static void ParseInnerContent(StringBuilder builder, PageInfo pageInfo, ContextInfo contextInfo)
        {
            if (builder == null || builder.Length == 0)
            {
                return;
            }

            var isInnerElement = contextInfo.IsInnerElement;

            contextInfo.IsInnerElement = true;
            StlElementParser.ReplaceStlElements(builder, pageInfo, contextInfo);
            StlEntityParser.ReplaceStlEntities(builder, pageInfo, contextInfo);
            contextInfo.IsInnerElement = isInnerElement;
        }
Esempio n. 4
0
        public static string ParsePreviewContent(SiteInfo siteInfo, string content)
        {
            var templateInfo = new TemplateInfo();
            var pageInfo     = new PageInfo(siteInfo.Id, 0, siteInfo, templateInfo);
            var contextInfo  = new ContextInfo(pageInfo);

            var parsedBuilder = new StringBuilder(content);

            StlElementParser.ReplaceStlElements(parsedBuilder, pageInfo, contextInfo);
            StlEntityParser.ReplaceStlEntities(parsedBuilder, pageInfo, contextInfo);

            var pageAfterBodyScripts = GetPageBodyCodes(pageInfo);

            return(pageAfterBodyScripts + parsedBuilder);
        }
Esempio n. 5
0
        public static string ParsePreviewContent(PublishmentSystemInfo publishmentSystemInfo, string content)
        {
            var templateInfo = new TemplateInfo();
            var pageInfo     = new PageInfo(publishmentSystemInfo.PublishmentSystemId, 0, publishmentSystemInfo, templateInfo, null);
            var contextInfo  = new ContextInfo(pageInfo);

            var parsedBuilder = new StringBuilder(content);

            StlElementParser.ReplaceStlElements(parsedBuilder, pageInfo, contextInfo);
            StlEntityParser.ReplaceStlEntities(parsedBuilder, pageInfo, contextInfo);

            var pageAfterBodyScripts  = GetPageInfoScript(pageInfo, true);
            var pageBeforeBodyScripts = GetPageInfoScript(pageInfo, false);

            return(pageAfterBodyScripts + parsedBuilder + pageBeforeBodyScripts);
        }